From: Daniel Gruno Date: Sat, 31 Mar 2012 08:17:18 +0000 (+0000) Subject: Rebuild X-Git-Tag: 2.2.23~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eeececbbf73087b02ff26b5736203984bc903407;p=thirdparty%2Fapache%2Fhttpd.git Rebuild git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1307738 13f79535-47bb-0310-9956-ffa450edef68 --- 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