Search For rewritecond

FREE THOUGHT · FREE SOFTWARE · FREE WORLD

Search Results

.Htaccess rewrites, Mod_Rewrite Tricks and Tips

Be aware that mod_rewrite (RewriteRule, RewriteBase, and RewriteCond) code is executed for each and every HTTP request that accesses a file in or below the

27 Request Methods for Apache rewritecond htaccess - AskApache

List of the 27 Request Methods available for Apache and rewritecond and htaccess.www.askapache.com/;27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html

Mod_Rewrite Variables Cheatsheet - www.askapache.com

If the pattern matches, then the RewriteCond's are checked. . The default is [AND] when dealing with multiple RewriteCond rules. To do an 'or'you need

AskApache Search

Using TIME_HOUR and TIME_MIN for htaccess RewriteCond. Describes the use of the TIME_HOUR and TIME_MIN variables with RewriteCond and RewriteRule in

Smart HTTP and HTTPS .htaccess Rewrite

Basically instead of having to check for HTTPS using a RewriteCond for every .. [env=https:s] # redirect urls with index.html to folder RewriteCond

Serve Alternate Content based on Time - AskApache

Jul 10, 2007 Apache mod_rewrite code to serve alternate versions of a file depending on the server time - week, month, hour, year, second.

Fresh .htaccess Examples:Cookies, Variables, Custom Headers

HTTP/ [NC, OR] RewriteCond %{QUERY_STRING} ^feed [NC] RewriteCond RewriteEngine On RewriteBase / RewriteCond %{HTTP:Accept-Language} ^.

301 Redirect Cheatsheet - AskApache

Feed for this Entry ·Trackback ·htaccess rewritecond. Tags:301 Redirect, 302 Redirect, 404 Not Found, Apache, Apache Htaccess, askapache, ASP, www.askapache.com/;list-of-methods-to-redirect-users-to-different-page.html

Commonly Used htaccess Code - AskApache

[NC] RewriteRule ^ http://%1%{REQUEST_URI} [L, R=301] #If you want to cover both http and https:Options +FollowSymlinks RewriteEngine On RewriteCond

htaccess rewrite, htaccess - AskApache

f # Existing File RewriteCond %{REQUEST_FILENAME} !-d # Existing Directory RewriteRule . RewriteCond %{HTTP_REFERER} !^http://(subdomain\.)?domain.tld/.

htaccess HTTPS / SSL Tips, Tricks, and Hacks

RewriteCond %{SERVER_PORT} !^443$ RewriteRule . RewriteCond %{SERVER_PORT} ^80$ RewriteRule . RewriteCond %{HTTPS} !=on RewriteRule "^(/secure/.

AskApache Web Development

No https except to wpadmin If the request is empty implies fopen or normal file access by a php script RewriteCond %{THE_REQUEST} ^OR OR if the request if

Redirect index.php to root - AskApache

Then I would be able to find the correct RewriteCond's using the mod_rewrite Options +FollowSymlinks RewriteEngine on rewritecond %{http_host}

Mod_Rewrite Basic Examples - AskApache

($1 is from RewriteRule line, and %1 is from RewriteCond line.) and we can't use variables in the right had side of the RewriteCond.

Redirecting RSS to Feedburner - AskApache

[L, R=307] # Comment feeds can be called via /comments, wp-commentsrss2, or withcomments=1 to the main feed script RewriteCond %{REQUEST_URI}

The Ultimate Htaccess

RewriteEngine On RewriteBase RewriteCond %{REQUEST_FILENAME}f RewriteRule . RewriteCond %{HTTPContentDisposition}phpNC RewriteCond %{HTTPContentType}

htaccess Tricks for Webmasters

RewriteEngine On RewriteBase / RewriteCond %{REMOTE_HOST} ! . RewriteCond %{REQUEST_METHOD} HEAD RewriteRule .* /cgi-bin/head-robot.cgi. mindrape ~

.htaccess – Wikipedia

Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ! Using TIME_HOUR and TIME_MIN for htaccess RewriteCond »

Hacking WP Super Cache for Speed - AskApache

BEGIN WordPress RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} ! . “RewriteCond %{HTTP:Accept-Encoding} gzip” in the original causes a Vary:

Blocking Bad Bots and Scrapers with .htaccess - AskApache

Blocking Bad Robots and Web Scrapers with RewriteRules. ErrorDocument 403 /403.html RewriteEngine On RewriteBase / # IF THE UA STARTS WITH THESE RewriteCond

Apache Authentication in htaccess - AskApache

/index.php [L] #</IfModule>### REQUIRE WWW #RewriteCond %{HTTP_HOST} ! /$1 [R=301, L] ### STOP LOOP CODE #RewriteCond %{ENV:REDIRECT_STATUS} 200

Log all .htaccess/.htpasswd logins

ErrorDocument 401 /logins.php RewriteEngine On RewriteBase / RewriteCond %{ENV:REDIRECT_STATUS} ^401$ [OR] RewriteCond %{REQUEST_URI} ^/.

trick

TIME_DAY Time RewriteCond Time-dependant rewriting uses mod_rewrite and apache .. Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond

.htaccess mod_rewrite rewrite examples

RewriteCond %{HTTP_HOST} !^www\.askapache\.com$ [NC] RewriteRule ^(. RewriteCond %{HTTP:Accept-Language} ^.*(de|es|fr|it|ja|ru|en).

.htaccess trick to show Alternate CSS file based on IP

BEGIN WordPress <IfModule mod_rewrite.c>RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} ! www.askapache.com/;htaccess-trick-to-show-alternate-css-file-based-on-ip.html

WordPress Plugin for Apache .htaccess Security - AskApache

/blog/index.php [L] </IfModule># END WordPress # BEGIN AskApache PassPro <IfModule mod_rewrite.c>RewriteEngine On RewriteBase / # sid1000 RewriteCond

301 Redirect with mod_rewrite or RedirectMatch - AskApache

Control htaccess Basic Authentication with PHP and mod_rewrite ·27 Request Methods for Apache rewritecond htaccess » www.askapache.com/;301-redirect-with-mod_rewrite-or-redirectmatch.html

Rewrite underscores to hyphens for SEO URL

$1-$2 [E=underscores:Yes] RewriteCond %{ENV:underscores} ^Yes$ RewriteRule (. RewriteCond %{QUERY_STRING} ^source= RewriteRule (.*) /$1? [R=301, L]

Instruct Search Engines to come back to site after you finish

ErrorDocument 503 /maintenance.htm # Custom 503 error page # Developer Address RewriteCond %{REMOTE_ADDR} !^192\.168\.1\.1$ # Only rewrite dynamic pages

Pimp out your FeedBurner Count - AskApache

RewriteEngine On RewriteBase / RewriteCond %{TIME_SEC} ^.([0-9]) [NC] RewriteRule f RewriteRule ^feed\.gif$ /zi/feed1.gif [S=3] RewriteCond %{TIME_SEC}

Fight Blog Spam with Apache - AskApache

Also, Cindy alerted me to the fact that adding:RewriteCond %{HTTP:VIA} ^. [F, L] # A new tactic - using SetEnvIfNoCase instead of RewriteCond - seems to

WordPress

Perl, PHP, Port, post, Prompt, ram, Redirect, Request Method, Rewrite Tricks, rewritecond, rewriterule, Robot, robots, Scanners, Security, SEO, server,

mod_rewrite Fix for Caching Updated Files - AskApache

Oct 20, 2008 RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .+ /z/%2/%3.

Securing php.ini and php.cgi with .htaccess - AskApache

ErrorDocument 403 /error.php RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^.*\.(php|cgi)$ RewriteCond %{ENV:REDIRECT_STATUS} !200 RewriteRule .

Crazy Advanced Mod_Rewrite Tutorial - AskApache - Crazy Advanced

You should only use mod_rewrite's rewriterule when you use a rewritecond or if you are rewriting internally like my feedcount hack.

Site Map

Mod_Rewrite Variables Cheatsheet Mod_Rewrite Variable Cheatsheet List of All Variables used by RewriteCond and actual variable Value

Using TIME_HOUR and TIME_MIN for htaccess RewriteCond - AskApache

Describes the use of the TIME_HOUR and TIME_MIN variables with RewriteCond and RewriteRule in Apache .htaccess.www.askapache.com/;using-time_hour-and-time_min-rewritecond-in-htaccess-2.html

Advanced .htaccess Tricks for Securing Sites - AskApache

A tip that springs to mind is that you can match *any* string in RewriteRule and RewriteCond directives with a regex start of line anchor ( ^ ) used on its

.htaccess Plugin Blocks Spam, Hackers, and Password Protects Blog

Nov 22, 2008 RewriteCond %{HTTP:Content-Disposition} \.php [NC] RewriteCond .. May break plugins/themes #RewriteCond %{THE_REQUEST} ^[A-Z]{3, 9}\ www.askapache.com/;htaccess-plugin-blocks-spam-hackers-and-password-protects-blog.html

Advanced Htaccess Demo/Example using Cookies, Headers, Rewrites

pdf$ - [S=2] # # The first RewriteCond checks to see if the . [F] # # Handle PDF files named anything-i.pdf as inline # RewriteCond %{REQUEST_FILENAME} !

Port

From specific domains RewriteEngine on RewriteCond %{HTTP_REFERER} Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !

Security Enhancing with htaccess

Options -ExecCGI -Indexes -All RewriteEngine On RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD) RewriteRule .* - [F] RewriteEngine Off

stat

Tags:301 Redirect, 404 Not Found, 503, Apache, askapache, CSS, curl, Firefox, GET, Htaccess, Mod_Rewrite, PHP, Redirect, Rewrite Tricks, rewritecond,

A better way to use PDF files online - AskApache

This .htaccess mod_rewrite code goes in your sites root .htaccess file and uses a RewriteCond to make sure that the file exists, it then rewrites the

htaccess directives available on Powweb - AskApache

when AllowOverride includes FileInfo;RewriteCond (mod_rewrite.c):an input string and a to be applied regexp-pattern when AllowOverride includes FileInfo

Skeleton .htaccess file for Powweb Hosting - AskApache

RewriteEngine On RewriteBase / ### REQUIRE WWW ### RewriteCond %{HTTP_HOST} !^www\.site\.com$ [NC] RewriteRule ^(.*)$ http://www.site.com/$1 [R=301, L]

Manipulating HTTP Headers with htaccess

RewriteEngine on rewritecond %{http_host} ^ninjatactics.net [nc] rewriterule ^(.*)$ http://www.ninjatactics.net/$1 [r=301, nc] FileETag None Header unset

Advanced Htaccess – SSI, ErrorDocuments, DirectoryIndexing SEO

HTTP/ [NC, OR] RewriteCond %{THE_REQUEST} ^[A-Z]{3, 9}\ /.*\.(asp|ini|dll).*\ HTTP/ [NC] RewriteRule .* - [F] ErrorDocument 403 /errordocs/f-off.html

TIME_DAY Time RewriteCond

Jul 11, 2007 TIME_DAY Time RewriteCond. Serve Alternate Content based on Time » TIME_DAY Time RewriteCond. TIME_DAY Time RewriteCond

Htaccess SetEnvIf and SetEnvIfNoCase Examples - AskApache

See the RewriteCond directive of mod_rewrite for extra information on how to match your query string. The name of an environment variable in the list of

Real-Life Htaccess Files from My Server

#### No https except to wp-admin -
# If the request is empty ( implies fopen or normal file access by a php script )
RewriteCond %{THE_REQUEST} ^$ [OR]
 
# OR if the request if for wp-admin or wp-login.php
RewriteCond %{REQUEST_URI} ^/(wp-admin|wp-login\.php).*$ [NC,OR]
 
# OR if the Referer is https
RewriteCond %{HTTP_REFERER} ^https://www.askapache.com/.*$ [NC]
 
# THEN skip the following rule, basically all this does is force https or badhost to be redirected
# BUT because of the above 3 rewritecond's, this won't break poorly written admin scripts
RewriteRule .* - [S=1]
 
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{HTTP_HOST} !^www\.askapache\.com$ [NC]
RewriteRule .* http://www.askapache.com%{REQUEST_URI} [R=301,L]
 
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(wp-admin/.*|wp-login\.php.*)\ HTTP/ [NC]
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

Protecting Files with Advanced Mod_Rewrite Anti-Hotlinking

If you have files on your site that you don’t want indexed by malicious search engines, grabbed and leeched by malicious spammers, or stolen and made available elsewhere, you can use mod_rewrite to drastically reduce or totally reduce that activity.

Crazy Advanced Mod_Rewrite Tutorial

Note: Extremely ILL Content
Find the key to unlocking mod_rewrite and you WILL be sick.. sick with a diamond disease on your wrist!

mod_rewrite Fix for Caching Updated Files

Web Developers sometimes use file.ext?v=004 as a version control system to force visitors to use updated files. This is terrible. Instead link to apache-003.css and set it to be cached forever. When you change the file you just change the links to apache-004.css. That eliminates millions of bandwidth and resource robbing If-Modified-Since requests. You only need Apache with mod_rewrite, and 1-10 minutes!

An AskApache Plugin Upgrade to Rule them All

An AskApache Plugin Upgrade to Rule them AllSo my blog as been rather quiet for almost a year now, and very few updates if any have been released for my Password Protection PLugin, my Google 404 Plugin, and definately not for my AskApache CrazyCache plugin, which I will be releasing last… So for all of you who’ve helped me out by sending me suggestions and notifying me of errors and sticking with it… Just wanted to say sorry about that, and thanks for all the great ideas.. Well, I’ve been sticking with it as well believe it our not. I manage to get free days once in a while, and then its time to jam.

Advanced Htaccess Demo/Example using Cookies, Headers, Rewrites

Whoa pretty sweet huh? Bet you’ve never seen that before! As I explain the htaccess code that achieves this, keep in mind this is merely one simple application for this code. It’s much more advanced than your basic htaccess trick, notice how this htaccess acts like a php script, very unusual.. I really wanted to share this trick after I created it for one of my clients because this is the tip of the iceberg. Another use would be to display an alternate style sheet depending on a users theme preference. The coolest thing about this example IMHO is that it uses multiple advanced .htaccess ideas in order for it to work, most htaccess code on the net is very singular. This code uses mod_headers to set the Content-Disposition header for forcing a download and uses mod_rewrite to do the rest.

Advanced Htaccess – SSI, ErrorDocuments, DirectoryIndexing SEO

htaccess directory indexingErrorDocument from .htaccess3-Part article covering practical implementation of 3 advanced .htaccess features. Discover an easy way to boost your SEO the AskApache way (focus on visitors), a tip you might keep and use for life. Get some cool security tricks to use against spammers, crackers, and other nefarious sorts. Take your site’s error handling to the next level, enhanced ErrorDocuments that go beyond 404′s.

Htaccess SetEnvIf and SetEnvIfNoCase Examples

SetEnv, SetEnvIf, and SetEnvIfNoCase directives conditionally set environment variables accessible by scripts and apache based on HTTP Headers, Variables, and Request information.

Apache HTTPD and Module API Versions

A list of API Versions and the corresponding HTTPD Version, for use in determining the version of Apache currently running without having to rely on the often inaccurate SERVER_SOFTWARE Header.

.htaccess trick to show Alternate CSS file based on IP

This past week I updated my sites apache.css file for a site-redesign. I wanted to make changes to the .css file that only I could see, so that my regular traffic and site-visitors would still see the old version. Here’s the elegant solution I came up with using .htaccess and mod_rewrite that works so well I’m sharing it with all you wonderful and incredible people reading my blog :)

Mod_Rewrite Variables Cheatsheet

We’ve figured out what mod_rewrite variables look like, a cheatsheet of the actual value.

Pimp out your FeedBurner Count

I’ve had a lot of people ask about the FeedBurner FeedCount image on AskApache. Specifically how to set it up with custom messages and different colors each page view… It is pretty sweet..

Notes from Apache HTTPD Source Code

thought I’d take a break from coding and post about how open-source is such a great tool for finding the best answers to the toughest questions,

/** is the status code informational */
#define ap_is_HTTP_INFO(x)         (((x) >= 100)&&((x) < 200))
/** is the status code OK ?*/
 
#define ap_is_HTTP_SUCCESS(x)      (((x) >= 200)&&((x) < 300))
/** is the status code a redirect */
#define ap_is_HTTP_REDIRECT(x)     (((x) >= 300)&&((x) < 400))
 
/** is the status code a error (client or server) */
#define ap_is_HTTP_ERROR(x)        (((x) >= 400)&&((x) < 600))
/** is the status code a client error  */
 
#define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
/** is the status code a server error  */
#define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
 
/** is the status code a (potentially) valid response code?  */
#define ap_is_HTTP_VALID_RESPONSE(x) (((x) >= 100)&&((x) < 600))

Securing php.ini and php.cgi with .htaccess

If you have a php.cgi or php.ini file in your /cgi-bin/ directory or other pub directory, try requesting them from your web browser. If your php.ini shows up or worse you are able to execute your php cgi, you’ll need to secure it ASAP. This shows several ways to secure these files, and other interpreters like perl, fastCGI, bash, csh, etc.

Smart HTTP and HTTPS .htaccess Rewrite

This is freaking sweet if you use SSL I promise you! Basically instead of having to check for HTTPS using a RewriteCond %{HTTPS} =on for every redirect that can be either HTTP or HTTPS, I set an environment variable once with the value “http” or “https” if HTTP or HTTPS is being used for that request, and use that env variable in the RewriteRule.


  Search Feed
  Comments Feed

Clusty

Ask.com

Yahoo

Windows


It's very simple - you read the protocol and write the code. -Bill Joy

HTML | DCMI | GRDDL | XOXO | XDMP | XFN | DOM | XML | XHTML 1.1 Strict | CSS 2.1 | W3C

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. NCSA HTTPd.
UNIX ® is a registered Trademark of The Open Group. POSIX ® is a registered Trademark of The IEEE.

Site Map | Contact Webmaster | Glossary | License and Disclaimer | Terms of Service

↑ TOP
Main