From eeececbbf73087b02ff26b5736203984bc903407 Mon Sep 17 00:00:00 2001 From: Daniel Gruno Date: Sat, 31 Mar 2012 08:17:18 +0000 Subject: [PATCH] Rebuild git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1307738 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/rewrite/flags.html.en | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/manual/rewrite/flags.html.en b/docs/manual/rewrite/flags.html.en index 692125286e8..0ca7a9d0cd5 100644 --- a/docs/manual/rewrite/flags.html.en +++ b/docs/manual/rewrite/flags.html.en @@ -606,10 +606,30 @@ RewriteRule (.*\.html) docs.php?$1 RewriteRule immediately following it. Thus, if you want to make a RewriteCond apply to several RewriteRules, one possible technique is to -negate those conditions and use a [Skip] flag. So, you can -use this to make pseudo if-then-else constructs: The last rule of -the then-clause becomes skip=N, where N is the -number of rules in the else-clause.

+negate those conditions and add a RewriteRule with a [Skip] flag. You can +use this to make pseudo if-then-else constructs: The last rule of +the then-clause becomes skip=N, where N is the +number of rules in the else-clause:

+

+# Does the file exist?
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+# Create an if-then-else construct by skipping 3 lines if we meant to go to the "else" stanza.
+RewriteRule .? - [S=3]
+
+# IF the file exists, then: + + RewriteRule (.*\.gif) images.php?$1
+ RewriteRule (.*\.html) docs.php?$1
+ # Skip past the "else" stanza.
+ RewriteRule .? - [S=1]
+
+# ELSE... + + RewriteRule (.*) 404.php?file=$1
+
+# END +

top

T|type

-- 2.47.3