From: Ralf S. Engelschall Date: Wed, 25 Mar 1998 08:03:48 +0000 (+0000) Subject: - more RegEx hints, especially to the Friedl-book X-Git-Tag: APACHE_BIG_SYMBOL_RENAME_POST~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=749ac506eb63572fd9314a6f7cbd251c79463911;p=thirdparty%2Fapache%2Fhttpd.git - more RegEx hints, especially to the Friedl-book - update of the directive blocks to be directive-dict.html compliant git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@80647 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_rewrite.html b/docs/manual/mod/mod_rewrite.html index 71e6bd5aee0..241a17ac0ae 100644 --- a/docs/manual/mod/mod_rewrite.html +++ b/docs/manual/mod/mod_rewrite.html @@ -297,9 +297,25 @@ of the available directives. Context: server config, virtual host, per-directory config
-

+>Context: server config, virtual host, directory, .htaccess
+Override: FileInfo
+Status: Extension
+Module: mod_rewrite.c
+Compatibility: Apache 1.2
+

The RewriteEngine directive enables or disables the runtime rewriting engine. If it is set to off this module does no runtime processing at all. It does not even update the SCRIPT_URx @@ -322,17 +338,33 @@ directive for each virtual host you wish to use it in. Syntax: RewriteOptions Option ...
+>Syntax: RewriteOptions Option
Default: -None-
+>Default: None
Context: server config, virtual host, per-directory config
-

+>Context: server config, virtual host, directory, .htaccess
+Override: FileInfo
+Status: Extension
+Module: mod_rewrite.c
+Compatibility: Apache 1.2
+

The RewriteOptions directive sets some special options for the current per-server or per-directory configuration. The Option strings can be one of the following: @@ -358,13 +390,29 @@ strings can be one of the following: Default: -None-
+>Default: None
Context: server config, virtual host
-

+Override: Not applicable
+Status: Extension
+Module: mod_rewrite.c
+Compatibility: Apache 1.2
+

The RewriteLog directive sets the name of the file to which the server logs any rewriting actions it performs. If the name does not begin with a slash ('/') then it is assumed to be relative to the @@ -421,6 +469,22 @@ RewriteLog "/usr/local/var/apache/logs/rewrite.log" HREF="directive-dict.html#Context" REL="Help" >Context: server config, virtual host
+Override: Not applicable
+Status: Extension
+Module: mod_rewrite.c
+Compatibility: Apache 1.2

The RewriteLogLevel directive set the verbosity level of the rewriting @@ -461,11 +525,27 @@ RewriteLogLevel 3 Default: -None-
+>Default: None
Context: server config, virtual host
+Override: Not applicable
+Status: Extension
+Module: mod_rewrite.c
+Compatibility: Apache 1.3

This directive sets the filename for a synchronization lockfile which @@ -491,6 +571,22 @@ SAMP using all other types of rewriting maps. HREF="directive-dict.html#Context" REL="Help" >Context: server config, virtual host
+Override: Not applicable
+Status: Extension
+Module: mod_rewrite.c
+Compatibility: Apache 1.2 (partially), Apache 1.3

The RewriteMap directive defines a Rewriting Map @@ -704,7 +800,23 @@ only happens once! Context: per-directory config
+>Context: directory, .htaccess
+Override: FileInfo
+Status: Extension
+Module: mod_rewrite.c
+Compatibility: Apache 1.2

The RewriteBase directive explicitly sets the base URL for @@ -812,11 +924,27 @@ sure the design and implementation is correct. Default: -None-
+>Default: None
Context: server config, virtual host, per-directory config
+>Context: server config, virtual host, directory, .htaccess
+Override: FileInfo
+Status: Extension
+Module: mod_rewrite.c
+Compatibility: Apache 1.2 (partially), Apache 1.3

The RewriteCond directive defines a rule condition. Precede a @@ -1135,11 +1263,27 @@ use any other browser you get the standard homepage. Default: -None-
+>Default: None
Context: server config, virtual host, per-directory config
+>Context: server config, virtual host, directory, .htaccess
+Override: FileInfo
+Status: Extension
+Module: mod_rewrite.c
+Compatibility: Apache 1.2 (partially), Apache 1.3

The RewriteRule directive is the real rewriting workhorse. The @@ -1164,31 +1308,56 @@ Some hints about the syntax of regular expressions:

-^           Start of line
-$           End of line
-.           Any single character
-[chars]     One of chars
-[^chars]    None of chars
-
-?           0 or 1 of the preceding char
-*           0 or N of the preceding char
-+           1 or N of the preceding char
-
-\char       escape that specific char
-            (e.g. for specifying the chars ".[]()" etc.)
-
-(string)    Grouping of chars (the Nth group can be used on the RHS with $N)
+Text:
+  .           Any single character
+  [chars]     Character class: One  of chars
+  [^chars]    Character class: None of chars
+  text1|text2 Alternative: text1 or text2
+
+Quantifiers:
+  ?           0 or 1 of the preceding text
+  *           0 or N of the preceding text (N > 1)
+  +           1 or N of the preceding text (N > 1)
+
+Grouping:
+  (text)      Grouping of text
+              (either to set the borders of an alternative or
+              for making backreferences where the Nth group can 
+              be used on the RHS of a RewriteRule with $N)
+
+Anchors:
+  ^           Start of line anchor
+  $           End   of line anchor
+
+Escaping:
+  \char       escape that particular char
+              (for instance to specify the chars ".[]()" etc.)
 

-Additionally the NOT character ('!') is a possible pattern -prefix. This gives you the ability to negate a pattern; to say, for instance: ``if -the current URL does NOT match to this pattern''. This can be used -for special cases where it is better to match the negative pattern or as a -last default rule. +For more information about regular expressions either have a look at your +local regex(3) manpage or its src/regex/regex.3 copy in the +Apache 1.3 distribution. When you are interested in more detailed and deeper +information about regular expressions and its variants (POSIX regex, Perl +regex, etc.) have a look at the following dedicated book on this topic: + +

+Mastering Regular Expressions
+Jeffrey E.F. Friedl
+Nutshell Handbook Series
+O'Reilly & Associates, Inc. 1997
+ISBN 1-56592-257-3
+
+ +

+Additionally in mod_rewrite the NOT character ('!') is a possible +pattern prefix. This gives you the ability to negate a pattern; to say, for +instance: ``if the current URL does NOT match to this +pattern''. This can be used for special cases where it is better to match +the negative pattern or as a last default rule.