You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2026/05/15 20:54:41 UTC
svn commit: r1934249 - httpd/httpd/trunk/docs/manual/rewrite
Author: rbowen
Date: Fri May 15 20:54:41 2026
New Revision: 1934249
Log:
flags.xml: Add example for UNC flag
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.
Modified:
httpd/httpd/trunk/docs/manual/rewrite/flags.xml
Modified: httpd/httpd/trunk/docs/manual/rewrite/flags.xml
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/flags.xml Fri May 15 20:03:35 2026 (r1934248)
+++ httpd/httpd/trunk/docs/manual/rewrite/flags.xml Fri May 15 20:54:41 2026 (r1934249)
@@ -1058,6 +1058,21 @@ the substitution is adequately constrain
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>