From: Rich Bowen Date: Mon, 25 May 2026 18:41:54 +0000 (+0000) Subject: docs: Add backreference flow diagram (Figure 3) in rewrite/tech X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=8ae2afd67b426eba451d0f95c18928293b14d6af;p=thirdparty%2Fapache%2Fhttpd.git docs: Add backreference flow diagram (Figure 3) in rewrite/tech Add SVG source and regenerated PNG for mod_rewrite_fig2 showing how backreferences flow: $N from RewriteRule Pattern (matched first) to all RewriteCond TestStrings and Substitution; %N from last matched CondPattern to Substitution. Insert as Figure 3 in tech.html. Add crosslink from intro.html backreferences section to the new diagram. Remove obsolete GIF. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934612 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/images/mod_rewrite_fig2.gif b/docs/manual/images/mod_rewrite_fig2.gif deleted file mode 100644 index 3ea8cb65a3f..00000000000 Binary files a/docs/manual/images/mod_rewrite_fig2.gif and /dev/null differ diff --git a/docs/manual/images/mod_rewrite_fig2.png b/docs/manual/images/mod_rewrite_fig2.png index 6ee23b009a0..9cadc8476b4 100644 Binary files a/docs/manual/images/mod_rewrite_fig2.png and b/docs/manual/images/mod_rewrite_fig2.png differ diff --git a/docs/manual/images/mod_rewrite_fig2.svg b/docs/manual/images/mod_rewrite_fig2.svg new file mode 100644 index 00000000000..b745e1f5d38 --- /dev/null +++ b/docs/manual/images/mod_rewrite_fig2.svg @@ -0,0 +1,102 @@ + + + + + + + + + + + + + Figure 2: Backreference Flow in mod_rewrite + + + ② evaluated + second + ① matched + first + + + RewriteCond 1 + + TestString + + CondPattern + + + RewriteCond 2 + + TestString + + CondPattern + + + ⋮ + ⋮ + ⋮ + + + RewriteCond n + + TestString + + CondPattern + + + RewriteRule + + Pattern + + Substitution + + + + + + + + + + + + + + + + + $1...$9 + + + + %1...%9 + + + $1...$9 + + + + $N — from RewriteRule Pattern (matched first) → all TestStrings + Substitution + + %N — from last matched CondPattern → Substitution + \ No newline at end of file diff --git a/docs/manual/rewrite/intro.xml b/docs/manual/rewrite/intro.xml index 0c6bc2c8008..c26eb4459fe 100644 --- a/docs/manual/rewrite/intro.xml +++ b/docs/manual/rewrite/intro.xml @@ -216,6 +216,8 @@ RewriteRule "!^/admin" "/xyz.html" [R,L] Figure 1: The back-reference flow through a rule.
In this example, a request for /test/1234 would be transformed into /admin.foo?page=test&id=1234&host=admin.example.com.

+

See also Technical Details + for a diagram showing backreference flow with multiple conditions.

diff --git a/docs/manual/rewrite/tech.xml b/docs/manual/rewrite/tech.xml index 9e3922b4ac6..8e1eded6381 100644 --- a/docs/manual/rewrite/tech.xml +++ b/docs/manual/rewrite/tech.xml @@ -258,6 +258,16 @@ RewriteRule "^/horses/ponies$" "/special-handler" [L] with the substitution of the URL with Substitution.

+

+ Flow of backreferences between RewriteRule and
+          RewriteCond directives
+ Figure 3:The flow of backreferences through a rule. + RewriteRule Pattern is matched first; its captures ($1...$9) + are available in all RewriteCond TestStrings. The last matched + CondPattern's captures (%1...%9) are available in Substitution. +

+