]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Adds example for [C] flag
authorRich Bowen <rbowen@apache.org>
Fri, 15 May 2026 17:17:07 +0000 (17:17 +0000)
committerRich Bowen <rbowen@apache.org>
Fri, 15 May 2026 17:17:07 +0000 (17:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934231 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/rewrite/flags.xml

index 23c4e5aa50ab0e4648978cd8e59b17bab119af1a..49a03d2f011b04902d2e5269dbf78650949d4770 100644 (file)
@@ -186,6 +186,17 @@ control moves on to the next rule. However, if it does not match, then
 the next rule, and any other rules that are chained together, are
 skipped.</p>
 
+<highlight language="config">
+# Rewrite legacy product URLs to the new catalog app,
+# and add a tracking parameter — but only for the rewritten ones.
+RewriteRule "^/products/([0-9]+)$" "/catalog/item/$1" [C]
+RewriteRule "^/catalog/(.*)$" "/catalog/$1?via=legacy" [QSA]
+</highlight>
+
+<p>Without the [C] flag, the second rule would also match requests
+that arrive at <code>/catalog/</code> directly. The chain ensures the
+second rule is only applied when the first rule matched.</p>
+
 </section>
 
 <section id="flag_co"><title>CO|cookie</title>