From: Rich Bowen Date: Fri, 15 May 2026 17:32:40 +0000 (+0000) Subject: rewrite/*.xml: Replace "URI" with "URL-path" or "URL" as appropriate X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=a2c1648c35dcd454a12c66a3a0218af295247b26;p=thirdparty%2Fapache%2Fhttpd.git rewrite/*.xml: Replace "URI" with "URL-path" or "URL" as appropriate While URI and URL are functionally interchangeable in web contexts (RFC 3986 subsumes both; every HTTP URL is a URI), the term "URI" is ambiguous about whether the scheme://host:port portion is included. "URL-path" — as defined in our own directive-dict.xml — makes explicit that only the path component is meant, which is what mod_rewrite actually operates on. Changes across avoid.xml, flags.xml, rewritemap.xml, and tech.xml: - "URI" → "URL-path" where the context is the path component only (what RewriteRule patterns match against) - "URI" → "URL" in the QSA/QSD/R sections where query strings are part of the discussion (URL-path excludes query strings by definition) - Kept "URI" in two places: the literal error message "Invalid URI in request", and "URI translation" (an official httpd hook/phase name) Resolves bz70043 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934233 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/rewrite/avoid.xml b/docs/manual/rewrite/avoid.xml index 297207460c..e85eed1c34 100644 --- a/docs/manual/rewrite/avoid.xml +++ b/docs/manual/rewrite/avoid.xml @@ -121,7 +121,7 @@ use.

URL Aliasing

The Alias directive -provides mapping from a URI to a directory - usually a directory outside +provides mapping from a URL-path to a directory - usually a directory outside of your DocumentRoot. Although it is possible to perform this mapping with mod_rewrite, Alias is the preferred method, for diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml index 7ba9f23ec8..b9fa42c755 100644 --- a/docs/manual/rewrite/flags.xml +++ b/docs/manual/rewrite/flags.xml @@ -301,7 +301,7 @@ each rule reflects only the value of PATH_INFO before this round of mod_rewrite processing. As a consequence, if large portions of the URL-path are matched and copied into a substitution in multiple RewriteRule directives, without regard for -which parts of the URI came from the current PATH_INFO, the final +which parts of the URL-path came from the current PATH_INFO, the final URL-path may have multiple copies of PATH_INFO appended to it.

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).

@@ -595,7 +595,7 @@ RewriteRule "(.+)[><;]$" "$1" [N=10]

Use of the [NC] flag causes the RewriteRule to be matched in a case-insensitive manner. That is, it doesn't care whether letters appear -as upper-case or lower-case in the matched URI.

+as upper-case or lower-case in the matched URL-path.

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 mod_proxy. If not, you will get an error from the proxy module. Use this flag to achieve a @@ -730,7 +730,7 @@ to use this flag.

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 RewriteRule to be passed back through URL mapping, so that location-based mappings, such as -.

QSA|qsappend

-When the replacement URI contains a query string, the default behavior +When the replacement URL contains a query string, the default behavior of RewriteRule is to discard the existing query string, and replace it with the newly generated one. Using the [QSA] flag causes the query strings to be combined. @@ -795,10 +795,10 @@ will be discarded.

QSD|qsdiscard

-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 RewriteRule is to copy that query -string to the target URI. Using the [QSD] flag causes the query string +string to the target URL. Using the [QSD] flag causes the query string to be discarded.

@@ -809,10 +809,10 @@ Using [QSD] and [QSA] together will result in [QSD] taking precedence.

-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.

@@ -874,7 +874,7 @@ status using their symbolic names: 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.

@@ -893,7 +893,7 @@ RewriteRule and any preceding RewriteCond directives match). This can be thought of as a goto statement in your rewrite ruleset. In the following example, we only want to run the -RewriteRule if the requested URI doesn't correspond with an +RewriteRule if the requested URL-path doesn't correspond with an actual file.

diff --git a/docs/manual/rewrite/rewritemap.xml b/docs/manual/rewrite/rewritemap.xml index 7b3193f671..263dd2f924 100644 --- a/docs/manual/rewrite/rewritemap.xml +++ b/docs/manual/rewrite/rewritemap.xml @@ -144,7 +144,7 @@ may be used, and give examples of each.

>RewriteRule:

-

Redirect a URI to an all-lowercase version of itself

+

Redirect a URL-path to an all-lowercase version of itself

RewriteMap lc int:tolower RewriteRule "(.*)" "${lc:$1}" [R] @@ -387,7 +387,7 @@ by many requests. Mutex directive.

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

diff --git a/docs/manual/rewrite/tech.xml b/docs/manual/rewrite/tech.xml index e73de19ddd..166ebc0431 100644 --- a/docs/manual/rewrite/tech.xml +++ b/docs/manual/rewrite/tech.xml @@ -97,7 +97,7 @@ and URL matching.

module="mod_alias">RedirectMatch) are present in the same server or virtual-host context, the rewrite rules are evaluated first. If a 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.

@@ -131,7 +131,7 @@ RewriteRule "^/old" "/other" [L]
URL Encoding and Decoding -

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 RewriteRule pattern matching takes place. A request for /my%20page/cats%3Fdogs is decoded to @@ -153,12 +153,12 @@ RewriteRule "^/horses/ponies$" "/special-handler" [L]

After substitution, mod_rewrite re-encodes the - resulting URI for output. Several flags control this behavior:

+ resulting URL-path for output. Several flags control this behavior:

  • [B] — re-escape backreferences so that special characters captured from the - decoded URI are not interpreted as delimiters in the + decoded URL-path are not interpreted as delimiters in the substitution.
  • [BNP] — when [B] is