]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_rewrite: Document how substitution paths are interpreted in all context/slash...
authorRich Bowen <rbowen@apache.org>
Mon, 4 May 2026 16:19:24 +0000 (16:19 +0000)
committerRich Bowen <rbowen@apache.org>
Mon, 4 May 2026 16:19:24 +0000 (16:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1933815 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_rewrite.xml

index 970e2c27bd97ad9fd4400edb592fd0ab3c4fa23e..ebb76dde29a10ded39d924194a473e245e70a853 100644 (file)
@@ -1281,6 +1281,28 @@ cannot use <code>$N</code> in the substitution string!
 
       </dl>
 
+      <note><title>How path substitutions are interpreted</title>
+      <p>Whether a path substitution is treated as a file-system path
+      or a URL-path depends on the context and whether it begins with
+      a slash:</p>
+      <ul>
+        <li><strong>Starts with <code>/</code>, server/vhost context:</strong>
+        Treated as a file-system path if the first path component exists
+        on disk; otherwise treated as a URL-path.</li>
+        <li><strong>Starts with <code>/</code>, per-directory context:</strong>
+        Always treated as a URL-path. No file-system guessing occurs.</li>
+        <li><strong>Does not start with <code>/</code> (relative),
+        server/vhost context:</strong> Treated as a URL-path relative
+        to the current request URI.</li>
+        <li><strong>Does not start with <code>/</code> (relative),
+        per-directory context:</strong> Treated as a URL-path relative
+        to the directory-path for which the <directive
+        module="core">Directory</directive> or <code>.htaccess</code>
+        applies. See <directive>RewriteBase</directive> for controlling
+        the prefix added to relative substitutions.</li>
+      </ul>
+      </note>
+
       <p>In addition to plain text, the <em>Substitution</em> string can include</p>
 
       <ol>