From: Rich Bowen
The
Use this flag on any substitution where the PATH_INFO that resulted @@ -366,7 +366,7 @@ contexts, including CGI programs, other RewriteRule directives, or CustomLog directives.
The following example sets an environment variable called 'image' to a -value of '1' if the requested URI is an image file. Then, that +value of '1' if the requested URL-path is an image file. Then, that environment variable is used to exclude those requests from the access log.
@@ -475,8 +475,8 @@ RewriteRule "\.exe" "-" [F]This example uses the "-" syntax for the rewrite target, which means -that the requested URI is not modified. There's no reason to rewrite to -another URI, if you're going to forbid the request.
+that the requested URL-path is not modified. There's no reason to rewrite to +another URL-path, if you're going to forbid the request.When using [F], an [L] is implied - that is, the response is returned immediately, and no further rules are evaluated.
@@ -575,7 +575,7 @@ so until there are no more As to be replaced. RewriteRule "(.*)A(.*)" "$1B$2" [N]You can think of this as a while loop: While this
-pattern still matches (i.e., while the URI still contains an
+pattern still matches (i.e., while the URL-path still contains an
A), perform this substitution (i.e., replace the
A with a B).
Use of the [NC] flag causes the
In the example below, any request for an image file will be proxied to your dedicated image server. The match is case-insensitive, so that @@ -684,7 +684,7 @@ pushed through the proxy, and any following rules will not be considered.
-You must make sure that the substitution string is a valid URI
+You must make sure that the substitution string is a valid URL
(typically starting with http://hostname) which can be
handled by the
The target (or substitution string) in a RewriteRule is assumed to be a
file path, by default. The use of the [PT] flag causes it to be treated
-as a URI instead. That is to say, the
+as a URL-path instead. That is to say, the
use of the [PT] flag causes the result of the
-When the replacement URI contains a query string, the default behavior
+When the replacement URL contains a query string, the default behavior
of
-When the requested URI contains a query string, and the target URI does
+When the requested URL contains a query string, and the target URL does
not, the default behavior of
-If the target URI has a query string, the default behavior will be
+If the target URL has a query string, the default behavior will be
observed - that is, the original query string will be discarded and
replaced with the query string in the RewriteRule target
-URI.
+URL.
temp (default),
You will almost always want to use [R] in conjunction with [L] (that is,
use [R,L]) because on its own, the [R] flag prepends
-http://thishost[:thisport] to the URI, but then passes this
+http://thishost[:thisport] to the URL-path, but then passes this
on to the next rule in the ruleset, which can often result in 'Invalid
URI in request' warnings.
goto statement in your rewrite ruleset. In the following
example, we only want to run the Redirect a URI to an all-lowercase version of itself
+Redirect a URL-path to an all-lowercase version of itself
A simple example is shown here which will replace all dashes with - underscores in a request URI.
+ underscores in a request URL-path.Rewrite configuration
RewriteRule matches and rewrites
- the URI (or returns a redirect), Redirect never sees
+ the URL-path (or returns a redirect), Redirect never sees
the request.
Apache httpd unescapes URL-encoded characters in the request URI before any +
Apache httpd unescapes URL-encoded characters in the request URL-path before any
/my%20page/cats%3Fdogs is decoded to
@@ -153,12 +153,12 @@ RewriteRule "^/horses/ponies$" "/special-handler" [L]
After substitution,