From: Eric Covener
This directive is required when you use a relative path - in a substitution in per-directory (htaccess) context unless either + in a substitution in per-directory (htaccess) context unless any of the following conditions are true:
Pattern is a perl compatible regular - expression. On the first RewriteRule, it is matched against - the (%-decoded) URL-path - of the request, or, in per-directory context (see below), the URL - path relative to that per-directory context. Subsequent patterns - are matched against the output of the last matching RewriteRule.
+ expression. What this pattern is compared against varies depending + on where theIn
In
In
In per-directory context (
The directory path where the rule is defined is stripped from the currently mapped + filesystem path before comparison (up to and including a trailing slash). + The net result of this per-directory prefix stripping is that rules in + this context only match against the portion of the currently mapped filesystem path + "below" where the rule is defined.
+ +Directives such as
If you wish to match against the hostname, port, or query string, use a +
If you wish to match against the hostname, port, or query string, use a
%{HTTP_HOST}
, %{SERVER_PORT}
, or
- %{QUERY_STRING}
variables respectively.
In any case, remember that regular expressions are substring
- matches. That is, you don't need the regex to describe the entire
- string, just the part that you wish to match. Thus, using a regex
- of .
is often sufficient rather than .*
,
- and the regex abc
is not the same as
- ^abc$
.
%{QUERY_STRING}
variables respectively.FollowSymLinks
for
a user's directory, then you cannot use the rewrite engine. This
restriction is required for security reasons..htaccess
files the
-per-directory prefix (that is, the URI path that lead to the directory
-containing this .htaccess
file)
-is automatically removed for the RewriteRule pattern matching
-and automatically added after any relative (not starting with a
-slash or protocol name) substitution encounters the end of a rule set.
-See the