From: Rich Bowen Date: Wed, 6 May 2026 18:30:37 +0000 (+0000) Subject: Fixes bz70027 - per-directory links to the Glossary, rather than X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96ed77cab28f933551560764c5ad2bce8184dc60;p=thirdparty%2Fapache%2Fhttpd.git Fixes bz70027 - per-directory links to the Glossary, rather than definining it as htaccess files, which is only part of the story. Also removes an example that I honestly cannot figure out what it is supposed to be illustrating. It may be worth adding a better example here at some point. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1933891 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index ebb76dde29..d6ac95a7ef 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -418,7 +418,7 @@ RewriteRule "^/ex/(.*)" "${examplemap:$1}" RewriteRule directives that substitute a relative path.

This directive is required when you use a relative path - in a substitution in per-directory (htaccess) context unless any + in a substitution in per-directory context unless any of the following conditions are true:

-

In the example below, RewriteBase is necessary - to avoid rewriting to http://example.com/opt/myapp-1.2.3/welcome.html - since the resource was not relative to the document root. This - misconfiguration would normally cause the server to look for an "opt" - directory under the document root.

- -DocumentRoot "/var/www/example.com" -AliasMatch "^/myapp" "/opt/myapp-1.2.3" -<Directory "/opt/myapp-1.2.3"> - RewriteEngine On - RewriteBase "/myapp/" - RewriteRule "^index\.html$" "welcome.html" -</Directory> - - @@ -770,7 +755,7 @@ AliasMatch "^/myapp" "/opt/myapp-1.2.3" after the URL translation phase (during which mod_rewrite operates).

On the other hand, because mod_rewrite implements - its per-directory context (.htaccess file) via + its per-directory context via the Fixup phase of the API and because the authorization phases come before this phase, you just can use %{REMOTE_USER} in that context.

@@ -1123,7 +1108,7 @@ RewriteRule "^/$" "/homepage.std.html" [L]

The directory-path to which the rule applies is stripped from the currently mapped filesystem path before comparison (up to and including a trailing slash). - The net result of this per-directory prefix stripping is that rules in + The net result of this per-directory prefix stripping is that rules in this context only match against the portion of the currently mapped filesystem path "below" the directory-path to which the rule applies.

@@ -1161,13 +1146,14 @@ directory. directive for more information regarding what prefix will be added back to relative substitutions. -
  • If you wish to match against the full URL-path in a per-directory context +
  • If you wish to match against the full URL-path in a +per-directory context RewriteRule, use the %{REQUEST_URI} variable in a RewriteCond.
  • The removed prefix always ends with a slash, meaning the matching occurs against a string which never has a leading slash. Therefore, a Pattern with ^/ never -matches in per-directory context.
  • +matches in per-directory context.
  • Although rewrite rules are syntactically permitted in Location and $N in the substitution string!
  • Starts with /, server/vhost context: Treated as a file-system path if the first path component exists on disk; otherwise treated as a URL-path.
  • -
  • Starts with /, per-directory context: +
  • Starts with /, per-directory context: Always treated as a URL-path. No file-system guessing occurs.
  • Does not start with / (relative), server/vhost context: Treated as a URL-path relative to the current request URI.
  • Does not start with / (relative), - per-directory context: Treated as a URL-path relative + per-directory context: Treated as a URL-path relative to the directory-path for which the Directory or .htaccess applies. See RewriteBase for controlling @@ -1421,7 +1407,7 @@ cannot use $N in the substitution string! END Stop the rewriting process immediately and don't apply any more rules. Also prevents further execution of rewrite rules - in per-directory context. (Available in 2.3.9 and later) + in per-directory context. (Available in 2.3.9 and later) details ... @@ -1450,7 +1436,7 @@ cannot use $N in the substitution string! last|L Stop the rewriting process immediately and don't apply any - more rules. Especially note caveats for per-directory context (see also the END flag). per-directory context (see also the END flag). details ...