]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
flags.xml: Add examples for [NS], [QSD], and [R] flags
authorRich Bowen <rbowen@apache.org>
Fri, 15 May 2026 18:10:54 +0000 (18:10 +0000)
committerRich Bowen <rbowen@apache.org>
Fri, 15 May 2026 18:10:54 +0000 (18:10 +0000)
These commonly-used flags had explanatory text but no configuration
examples. Add minimal, practical illustrations for each:
- [NS]: front controller pattern excluding subrequests
- [QSD]: redirect discarding the original query string
- [R]: 301 redirect to an external URL with path preserved

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

docs/manual/rewrite/flags.xml

index b9fa42c75501bc630042604040ac97db12c1a32f..1609b485b00ef2d31218d6e3ccbd8dbc3f091c59 100644 (file)
@@ -667,6 +667,15 @@ Images, javascript files, or css files, loaded as part of an HTML page,
 are not subrequests - the browser requests them as separate HTTP
 requests.
 </p>
+
+<highlight language="config">
+# Only rewrite direct requests to the front controller,
+# not subrequests from SSI includes or mod_dir.
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+RewriteRule "^(.*)$" "/app/index.php?page=$1" [NS,L]
+</highlight>
+
 </section>
 
 <section id="flag_p"><title>P|proxy</title>
@@ -815,6 +824,12 @@ replaced with the query string in the <code>RewriteRule</code> target
 URL.
 </p>
 
+<highlight language="config">
+# Redirect old search URLs to the new path, discarding the query string.
+# /search?q=term&amp;page=2  becomes  /find  (query string removed)
+RewriteRule "^/search" "/find" [QSD,R=301,L]
+</highlight>
+
 </section>
 
 <section id="flag_qsl"><title>QSL|qslast</title>
@@ -883,6 +898,11 @@ URI in request' warnings.
 spec.  Using an unrecognized status code will result in a 500 error and
 error log message.</p>
 
+<highlight language="config">
+# Redirect requests for the old docs path to the new location.
+RewriteRule "^/docs/(.*)$" "http://docs.example.com/$1" [R=301,L]
+</highlight>
+
 </section>
 
 <section id="flag_s"><title>S|skip</title>