diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index dc3a8dd80f..423aedc90f 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -117,9 +117,10 @@ URLs on the fly 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

@@ -206,7 +207,7 @@ URLs on the fly directory on disk but lack a trailing slash, in the expectation that the 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 @@ -236,7 +237,7 @@ URLs on the fly Available in Apache HTTP Server 2.4.3 and later.

- Security Warning + Security Warning

Enabling this option will make the server vulnerable to security issues if used with rewrite rules which are not @@ -265,8 +266,8 @@ URLs on the fly

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.

@@ -382,30 +383,31 @@ RewriteRule "^/ex/(.*)" "${examplemap:$1}"

The RewriteBase directive specifies the - URL prefix to be used for per-directory (htaccess) - RewriteRule directives that substitute a relative - path.

+ URL prefix to be used for per-directory (htaccess) + 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:

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.

@@ -614,9 +616,9 @@ AliasMatch "^/myapp" "/opt/myapp-1.2.3" been determined by the server at the time REQUEST_FILENAME is referenced. Otherwise, such as when used in virtual host context, the same - value as REQUEST_URI. Depending on the value of + value as REQUEST_URI. Depending on the value of AcceptPathInfo, the - server may have only used some leading components of the + server may have only used some leading components of the REQUEST_URI to map the request to a file. @@ -711,7 +713,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 @@ -842,6 +844,13 @@ AliasMatch "^/myapp" "/opt/myapp-1.2.3" -l by using the -L or -h variant. +
    -ne
    +
    Is numerically not equal to
    + The TestString is treated as an integer, and is + numerically compared to the CondPattern. True if + the two are numerically different. This is equivalent to + !-ne
    +
  • @@ -851,14 +860,14 @@ AliasMatch "^/myapp" "/opt/myapp-1.2.3"
    -d
    - +
    Is directory.
    Treats the TestString as a pathname and tests whether or not it exists, and is a directory.
    -f
    - +
    Is regular file.
    Treats the TestString as a pathname and tests @@ -875,13 +884,13 @@ AliasMatch "^/myapp" "/opt/myapp-1.2.3" it can impact your server's performance!
    -
    -H
    +
    -h
    Is symbolic link, bash convention.
    See -l.
    -l
    - +
    Is symbolic link.
    Treats the TestString as a pathname and tests whether or not it exists, and is a symbolic link. May also @@ -910,8 +919,8 @@ AliasMatch "^/myapp" "/opt/myapp-1.2.3" it can impact your server's performance!

    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.

    -x
    @@ -1006,7 +1015,7 @@ RewriteRule ...some special stuff for any of these hosts... 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 @@ -1043,7 +1052,6 @@ RewriteRule "^/$" "/homepage.std.html" [L] path relative to that per-directory context. Subsequent patterns are matched against the output of the last matching RewriteRule.

    - <a id="what_is_matched" name="what_is_matched">What is matched?</a>

    In VirtualHost context, The Pattern will initially be matched against the part of the @@ -1094,7 +1102,7 @@ relative substitutions.

  • If you wish to match against the full URL-path in a per-directory (htaccess) RewriteRule, use the %{REQUEST_URI} variable in -a RewriteCond.
  • +a RewriteCond.
  • The removed prefix always ends with a slash, meaning the matching occurs against a string which never has a leading slash. Therefore, a Pattern with ^/ never @@ -1141,7 +1149,7 @@ cannot use $N in the substitution string!
    Designates the location on the file-system of the resource to be delivered to the client. Substitutions are only - treated as a file-system path when the rule is configured in + treated as a file-system path when the rule is configured in server (virtualhost) context and the first component of the path in the substitution exists in the file-system
    @@ -1156,7 +1164,7 @@ cannot use $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 @@ -1205,9 +1213,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 @@ -1236,7 +1246,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 $N in the substitution string! qsappend|QSA - Appends any query string from the original request URL to + Appends any query string from the original request URL to any query string created in the rewrite target.details ... @@ -1368,7 +1378,7 @@ cannot use $N in the substitution string! qslast|QSL Interpret the last (right-most) question mark as the query string - delimeter, instead of the first (left-most) as normally used. + delimeter, instead of the first (left-most) as normally used. Available in 2.4.19 and later. details ...