From: Rich Bowen
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 @@ -143,7 +143,7 @@ handler. For example, one might use this to force all files without a file extension to be parsed by the php handler:
-RewriteRule !\. - [H=application/x-httpd-php .php]
+RewriteRule !\. - [H=application/x-httpd-php]
@@ -182,6 +182,10 @@ rules.
The [N] flag causes the ruleset to start over again from the top. Use with extreme caution, as it may result in loop. ++The [Next] flag could be used, for example, if you wished to replace a +certain string or letter repeatedly in a request. +
@@ -201,7 +205,21 @@ RewriteRule (.*\.(jpg|gif|png))$ http://images.example.com$1 [P,NC]No escape flag
+By default, special characters, such as &
and
+?
, for example, will be converted to their hexcode
+equivalent. Using the [NE] flag prevents that from happening.
+
+RewriteRule ^/anchor/(.+) /bigpage.html#$1 [NE,R]
+
+The above example will redirect /anchor/xyz
to
+/bigpage.html#xyz
. Omitting the [NE] will result in the #
+being converted to its hexcode equivalent, %23
.
+
This rule doesn't rewrite the request (the "-" rewrite target tells @@ -151,7 +151,7 @@ handler. For example, one might use this to force all files without a file extension to be parsed by the php handler:
@@ -192,6 +192,10 @@ rules.
The [N] flag causes the ruleset to start over again from the top. Use with extreme caution, as it may result in loop. ++The [Next] flag could be used, for example, if you wished to replace a +certain string or letter repeatedly in a request. +
@@ -212,7 +216,21 @@ RewriteRule (.*\.(jpg|gif|png))$ http://images.example.com$1 [P,NC]No escape flag
+By default, special characters, such as &
and
+?
, for example, will be converted to their hexcode
+equivalent. Using the [NE] flag prevents that from happening.
+
+The above example will redirect /anchor/xyz
to
+/bigpage.html#xyz
. Omitting the [NE] will result in the #
+being converted to its hexcode equivalent, %23
.
+