diff --git a/docs/manual/mod/mod_rewrite.html.en b/docs/manual/mod/mod_rewrite.html.en index e49c08b376..d3ec4331a9 100644 --- a/docs/manual/mod/mod_rewrite.html.en +++ b/docs/manual/mod/mod_rewrite.html.en @@ -117,30 +117,31 @@ URLs on the fly
The RewriteBase
directive specifies the
- URL prefix to be used for per-directory (htaccess)
- RewriteRule
directives that substitute a relative
- path.
RewriteRule
directives that
+ substitute a relative path.
This directive is required when you use a relative path in a substitution in per-directory (htaccess) context unless either of the following conditions are true:
DocumentRoot
- (as opposed to reachable by other means, such as
+ (as opposed to reachable by other means, such as
Alias
).RewriteRule
, suffixed by the relative
- substitution is also valid as a URL path on the server
+ RewriteRule
,
+ suffixed by the relative
+ substitution is also valid as a URL path on the server
(this is rare).Alias
or mod_userdir
. In the example below, RewriteBase
is necessary
to avoid rewriting to http://example.com/opt/myapp-1.2.3/welcome.html
- since the resource was not relative to the document root. This
+ since the resource was not relative to the document root. This
misconfiguration would normally cause the server to look for an "opt"
directory under the document root.
DocumentRoot "/var/www/example.com" @@ -344,9 +345,9 @@ AliasMatch "^/myapp" "/opt/myapp-1.2.3" been determined by the server at the timeREQUEST_FILENAME
is referenced. Otherwise, such as when used in virtual host context, the same - value asREQUEST_URI
. Depending on the value of + value asREQUEST_URI
. Depending on the value ofAcceptPathInfo
, the - server may have only used some leading components of the + server may have only used some leading components of theREQUEST_URI
to map the request to a file. @@ -441,7 +442,7 @@ AliasMatch "^/myapp" "/opt/myapp-1.2.3" so that certain conditions might not be evaluated at all.
%{LA-U:variable}
+ %{LA-U:variable}
can be used for look-aheads which perform
an internal (URL-based) sub-request to determine the final
value of variable. This can be used to access
@@ -572,6 +573,13 @@ AliasMatch "^/myapp" "/opt/myapp-1.2.3"
-l by using the -L or
-h variant.
+ !-ne
This flag only returns information about things like access control, authentication, and authorization. This flag - does not return information about the status code the - configured handler (static file, CGI, proxy, etc.) would have + does not return information about the status code the + configured handler (static file, CGI, proxy, etc.) would have returned.
RewriteCond "%{HTTP_USER_AGENT}" "(iPhone|Blackberry|Android)" RewriteRule "^/$" "/homepage.mobile.html" [L] -RewriteRule "^/$" "/homepage.std.html" [L]+RewriteRule "^/$" "/homepage.std.html" [L]
Explanation: If you use a browser which identifies itself
@@ -769,9 +777,10 @@ RewriteRule "^/$" "/homepage.std.html" [L]
RewriteEngine on
directive for each virtual host
in which you wish to use rewrite rules.
RewriteMap
directives of the type prg
+
RewriteMap
directives
+ of the type prg
are not started during server initialization if they're defined in a
- context that does not have RewriteEngine
set to
+ context that does not have RewriteEngine
set to
on
mod_dir
module will issue the client with a redirect to
the canonical URL with a trailing slash.
-
+
When the DirectorySlash
directive
is set to off, the AllowNoSlash
option can be enabled to ensure
that rewrite rules are no longer ignored. This option makes it possible to
@@ -977,7 +986,7 @@ RewriteRule "^/$" "/homepage.std.html" [L]
Available in Apache HTTP Server 2.4.3 and later.
Enabling this option will make the server vulnerable to security issues if used with rewrite rules which are not @@ -1004,8 +1013,8 @@ RewriteRule "^/$" "/homepage.std.html" [L]
When a relative substitution is made
in directory (htaccess) context and RewriteBase
has not been set, this module uses some
- extended URL and filesystem context information to change the
- relative substitution back into a URL. Modules such as
+ extended URL and filesystem context information to change the
+ relative substitution back into a URL. Modules such as
mod_userdir
and mod_alias
supply this extended context info.
In VirtualHost
context,
The Pattern will initially be matched against the part of the
@@ -1087,7 +1095,7 @@ relative substitutions.
%{REQUEST_URI}
variable in
-a RewriteCond
.RewriteCond
.
^/
never
@@ -1132,7 +1140,7 @@ cannot use $N
in the substitution string!
$N
in the substitution string!
you specify a Substitution string of
/www/file.html
, then this will be treated as a
URL-path unless a directory named www
- exists at the root or your file-system (or, in the case of
+ exists at the root or your file-system (or, in the case of
using rewrites in a .htaccess
file, relative to
your document root), in which case it will
be treated as a file-system path. If you wish other
@@ -1194,9 +1202,11 @@ cannot use $N
in the substitution string!
(N=0..9), which will be replaced
by the contents of the Nth group of the
matched Pattern. The server-variables are the same
- as for the TestString of a RewriteCond
+ as for the TestString of a
+ RewriteCond
directive. The mapping-functions come from the
- RewriteMap
directive and are explained there.
+ RewriteMap
+ directive and are explained there.
These three types of variables are expanded in the order above.
Rewrite rules are applied to the results of previous rewrite
@@ -1223,7 +1233,7 @@ cannot use $N
in the substitution string!
Additionally you can set special actions to be performed by
appending [
flags]
- as the third argument to the RewriteRule
+ as the third argument to the RewriteRule
directive. Flags is a comma-separated list, surround by square
brackets, of any of the flags in the following table. More
details, and examples, for each flag, are available in the Rewrite Flags document.
$N
in the substitution string!
$N
in the substitution string!