From: Rich Bowen Date: Fri, 15 May 2026 18:10:54 +0000 (+0000) Subject: flags.xml: Add examples for [NS], [QSD], and [R] flags X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b702ae8b24bae103908aa135944c3213bfeda28f;p=thirdparty%2Fapache%2Fhttpd.git flags.xml: Add examples for [NS], [QSD], and [R] flags 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 --- diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml index b9fa42c755..1609b485b0 100644 --- a/docs/manual/rewrite/flags.xml +++ b/docs/manual/rewrite/flags.xml @@ -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.

+ + +# 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] + +
P|proxy @@ -815,6 +824,12 @@ replaced with the query string in the RewriteRule target URL.

+ +# Redirect old search URLs to the new path, discarding the query string. +# /search?q=term&page=2 becomes /find (query string removed) +RewriteRule "^/search" "/find" [QSD,R=301,L] + +
QSL|qslast @@ -883,6 +898,11 @@ URI in request' warnings. spec. Using an unrecognized status code will result in a 500 error and error log message.

+ +# Redirect requests for the old docs path to the new location. +RewriteRule "^/docs/(.*)$" "http://docs.example.com/$1" [R=301,L] + +
S|skip