]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
flags.xml: Add example for UNC flag
authorRich Bowen <rbowen@apache.org>
Fri, 15 May 2026 20:54:41 +0000 (20:54 +0000)
committerRich Bowen <rbowen@apache.org>
Fri, 15 May 2026 20:54:41 +0000 (20:54 +0000)
Show a Windows UNC path rewrite using a variable in the substitution,
explaining that the flag prevents Apache from collapsing the leading
double slash. Note that the flag is Windows-only and unnecessary when
the substitution starts with literal double slashes.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934249 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/rewrite/flags.xml

index f6a2ba35920b1fc6df6a5a24ac890ac64968b1c6..a456336d8040c7860491a45a0b6c9d5f34e96913 100644 (file)
@@ -1058,6 +1058,21 @@ the substitution is adequately constrained.
     substitution starts with multiple literal slashes.</p>
 
     <p><since>2.5.1</since></p>
+
+<highlight language="config">
+# On Windows, rewrite to a UNC file share using a variable.
+# Without [UNC], the leading slashes in the substitution would be
+# collapsed (//server/share becomes /server/share).
+RewriteCond "%{HTTP_HOST}" "^(.+)\.internal$"
+RewriteRule "^/shared/(.*)$" "//%1/fileshare/$1" [UNC]
+</highlight>
+
+<p>This flag is only relevant on Windows. It prevents Apache from
+merging the leading double slash (<code>//</code>) that denotes a
+UNC path when the path is constructed from a backreference or
+variable. If the substitution begins with literal double slashes,
+no flag is needed.</p>
+
 </section>
 
 </manualpage>