From 9575a59c07b84a67df1cb6787258049fe33cac56 Mon Sep 17 00:00:00 2001 From: Daniel Gruno Date: Sat, 31 Mar 2012 08:12:58 +0000 Subject: [PATCH] Rebuild git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1307736 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/rewrite/flags.html.en | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/manual/rewrite/flags.html.en b/docs/manual/rewrite/flags.html.en index b7969c3d34..906226119c 100644 --- a/docs/manual/rewrite/flags.html.en +++ b/docs/manual/rewrite/flags.html.en @@ -653,10 +653,31 @@ 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 +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.

+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.40.0