From: Eric Covener
RewriteEngine On
-RewriteRule ^/index.html - [CO=frontdoor:yes:.apache.org:1440:/]
+RewriteRule ^/index\.html - [CO=frontdoor:yes:.apache.org:1440:/]
This rule doesn't rewrite the request (the "-" rewrite target tells
@@ -161,6 +161,22 @@ The regular expression above - !\. - will match any request
that does not contain the literal . character.
This can be also used to force the handler based on some conditions.
+For example, the following snippet used in per-server context allows
+.php files to be displayed by mod_php
+if they are requested with the .phps extension:
+
+
+RewriteRule ^(/source/.+\.php)s$ $1 [H=application/x-httpd-php-source]
+
The regular expression above - ^(/source/.+\.php)s$ - will
+match any request that starts with /source/ followed by 1 or
+n characters followed by .phps literally. The backreference
+$1 referrers to the captured match within parenthesis of the regular
+expression.
The [L] flag causes mod_rewrite to stop processing
@@ -192,7 +208,7 @@ argument to index.php, however, the index.php, the RewriteRule will be skipped.
-RewriteCond %{REQUEST_URI} !index\.php
+RewriteCond %{REQUEST_URI} !=index.php
RewriteRule ^(.*) index.php?req=$1 [L]
This rule doesn't rewrite the request (the "-" rewrite target tells
@@ -168,6 +168,22 @@ RewriteRule !\. - [H=application/x-httpd-php]
The regular expression above - !\. - will match any request
that does not contain the literal . character.
This can be also used to force the handler based on some conditions.
+For example, the following snippet used in per-server context allows
+.php files to be displayed by mod_php
+if they are requested with the .phps extension:
+
+
The regular expression above - ^(/source/.+\.php)s$ - will
+match any request that starts with /source/ followed by 1 or
+n characters followed by .phps literally. The backreference
+$1 referrers to the captured match within parenthesis of the regular
+expression.
index.php, the