From: Rich Bowen
In !') is also available as a possible pattern
- prefix. This enables you to negate a pattern; to say, for instance:
- ``if the current URL does NOT match this
- pattern''. This can be used for exceptional cases, where
- it is easier to match the negative pattern, or as a last
- default rule.
$N in the substitution string!
-For information on ! prefix to negate a pattern, see the
+ Regular Expressions
+ section of the mod_rewrite introduction.
The Substitution of a rewrite rule is the string that replaces the original URL-path that diff --git a/docs/manual/rewrite/intro.xml b/docs/manual/rewrite/intro.xml index ebeb393263..95b98c9623 100644 --- a/docs/manual/rewrite/intro.xml +++ b/docs/manual/rewrite/intro.xml @@ -163,11 +163,23 @@ well as write your own.
notc/t
-In ! character can be
+
The ! (Not) character can be
used before a regular expression to negate it. This is, a string will
be considered to have matched only if it does not match the rest of
the expression.
When using ! to negate a pattern, note that
+backreferences (e.g.
+$1, $2) are not available, since the
+pattern does not match.
For example, the following will redirect any request that does
+not start with /admin