From dc6c78aea75b78f20db4e9099151d4be6a13c919 Mon Sep 17 00:00:00 2001
From: Christophe Jaillet
mod_rewrite uses the Perl Compatible
+
.c.t will match cat,
-cot, cut, etc.+a+ matches a, aa,
-aaa, etc*a* matches all the same things
-a+ matches, but will also match an empty string.?colou?r will match color and colour..c.t will match cat, cot,
+ cut, etc+a+ matches a, aa,
+ aaa, etc*a* matches all the same things a+ matches,
+ but will also match an empty string?colou?r will match color and
+ colour\\. will match . (dot) and not any single
+ character as explain above^^a matches a string that begins with a$a$ matches a string that ends with a( )(ab)+ matches ababab - that is, the
+ + applies to the group. For more on backreferences see
+ below^^a matches a string that begins with
-a$a$ matches a string that ends with
-a.( )(ab)+
-matches ababab - that is, the + applies to the group.
-For more on backreferences see below.[ ]c[uoa]t matches cut,
-cot or cat.[^ ]c[^/]t matches cat or c=t but not c/t[ ]c[uoa]t matches cut, cot or
+ cat[^ ]c[^/]t matches cat or c=t but
+ not c/tIn ! character can be
@@ -145,22 +178,22 @@ the expression.
$N and
%N (see below). These are available for creating
- the Substitution parameter of a
+ the Substitution parameter of a
Captures in the
Figure 1 shows to which - locations the back-references are transferred for expansion as - well as illustrating the flow of the RewriteRule, RewriteCond - matching. In the next chapters, we will be exploring how to use - these back-references, so do not fret if it seems a bit alien +
Figure 1 shows to which + locations the back-references are transferred for expansion as + well as illustrating the flow of the RewriteRule, RewriteCond + matching. In the next chapters, we will be exploring how to use + these back-references, so do not fret if it seems a bit alien to you at first.
@@ -183,12 +216,12 @@ of three arguments separated by spaces. The arguments areThe Pattern is a regular expression. -It is initially (for the first rewrite rule or until a substitution occurs) -matched against the URL-path of the incoming request (the part after the -hostname but before any question mark indicating the beginning of a query -string) or, in per-directory context, against the request's path relative -to the directory for which the rule is defined. Once a substitution has +
The Pattern is a regular expression. +It is initially (for the first rewrite rule or until a substitution occurs) +matched against the URL-path of the incoming request (the part after the +hostname but before any question mark indicating the beginning of a query +string) or, in per-directory context, against the request's path relative +to the directory for which the rule is defined. Once a substitution has occurred, the rules that follow are matched against the substituted value.
@@ -289,7 +322,7 @@ argument is a list of flags that modify how the match is evaluated. different server, you could use:When more than @@ -301,8 +334,8 @@ their query string, unless they also contain a cookie containing the word "go", you could use:
Notice that the exclamation mark specifies a negative match, so the rule is only applied if the cookie does not contain "go".
@@ -315,7 +348,7 @@ will direct the request to a different directory depending on the hostname used to access the site:If the request was for http://example.com/foo/bar,
then %1 would contain example.com
@@ -354,5 +387,3 @@ the