Skip to content

Commit 246bd67

Browse files
committed
mod_rewrite: Document how substitution paths are interpreted in all context/slash combinations. PR 70020
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1933815 13f79535-47bb-0310-9956-ffa450edef68
1 parent 6310dd7 commit 246bd67

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

docs/manual/mod/mod_rewrite.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,28 @@ cannot use <code>$N</code> in the substitution string!
12811281

12821282
</dl>
12831283

1284+
<note><title>How path substitutions are interpreted</title>
1285+
<p>Whether a path substitution is treated as a file-system path
1286+
or a URL-path depends on the context and whether it begins with
1287+
a slash:</p>
1288+
<ul>
1289+
<li><strong>Starts with <code>/</code>, server/vhost context:</strong>
1290+
Treated as a file-system path if the first path component exists
1291+
on disk; otherwise treated as a URL-path.</li>
1292+
<li><strong>Starts with <code>/</code>, per-directory context:</strong>
1293+
Always treated as a URL-path. No file-system guessing occurs.</li>
1294+
<li><strong>Does not start with <code>/</code> (relative),
1295+
server/vhost context:</strong> Treated as a URL-path relative
1296+
to the current request URI.</li>
1297+
<li><strong>Does not start with <code>/</code> (relative),
1298+
per-directory context:</strong> Treated as a URL-path relative
1299+
to the directory-path for which the <directive
1300+
module="core">Directory</directive> or <code>.htaccess</code>
1301+
applies. See <directive>RewriteBase</directive> for controlling
1302+
the prefix added to relative substitutions.</li>
1303+
</ul>
1304+
</note>
1305+
12841306
<p>In addition to plain text, the <em>Substitution</em> string can include</p>
12851307

12861308
<ol>

0 commit comments

Comments
 (0)