From: Eric Covener Date: Mon, 22 Feb 2010 17:47:44 +0000 (+0000) Subject: clarification on REQUEST_FILENAME vs per-vhost Rewrite directives. X-Git-Tag: 2.2.15~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13506ac2f33f0daba0b91c7e3375e2387bde56ff;p=thirdparty%2Fapache%2Fhttpd.git clarification on REQUEST_FILENAME vs per-vhost Rewrite directives. backport of r914980 and partial backport r728399 (Bob Ionescu) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@914981 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_rewrite.html.en b/docs/manual/mod/mod_rewrite.html.en index 6d4a973810d..14c881e6fe4 100644 --- a/docs/manual/mod/mod_rewrite.html.en +++ b/docs/manual/mod/mod_rewrite.html.en @@ -393,7 +393,11 @@ Result:
REQUEST_FILENAME
The full local filesystem path to the file or - script matching the request.
+ script matching the request, if this has already + 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.
HTTPS
@@ -410,14 +414,25 @@ Result:

Other things you should be aware of:

    -
  1. The variables SCRIPT_FILENAME and REQUEST_FILENAME +
  2. The variables SCRIPT_FILENAME and REQUEST_FILENAME contain the same value - the value of the filename field of the internal request_rec structure of the Apache server. The first name is the commonly known CGI variable name while the second is the appropriate counterpart of REQUEST_URI (which contains the value of the - uri field of request_rec).

  3. + uri field of request_rec).

    +

    If a substitution occurred and the rewriting continues, + the value of both variables will be updated accordingly.

    +

    If used in per-server context (i.e., before the + request is mapped to the filesystem) SCRIPT_FILENAME and + REQUEST_FILENAME cannot contain the full local filesystem + path since the path is unknown at this stage of processing. + Both variables will initially contain the value of REQUEST_URI + in that case. In order to obtain the full local filesystem + path of the request in per-server context, use an URL-based + look-ahead %{LA-U:REQUEST_FILENAME} to determine + the final value of REQUEST_FILENAME.

  4. %{ENV:variable}, where variable can be diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index 3b46fd1cacf..d178b1115ca 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -794,7 +794,11 @@ Result:
    REQUEST_FILENAME
    The full local filesystem path to the file or - script matching the request.
    + script matching the request, if this has already + 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.
    HTTPS
    @@ -811,14 +815,25 @@ Result:

    Other things you should be aware of:

      -
    1. The variables SCRIPT_FILENAME and REQUEST_FILENAME +
    2. The variables SCRIPT_FILENAME and REQUEST_FILENAME contain the same value - the value of the filename field of the internal request_rec structure of the Apache server. The first name is the commonly known CGI variable name while the second is the appropriate counterpart of REQUEST_URI (which contains the value of the - uri field of request_rec).

    3. + uri field of request_rec).

      +

      If a substitution occurred and the rewriting continues, + the value of both variables will be updated accordingly.

      +

      If used in per-server context (i.e., before the + request is mapped to the filesystem) SCRIPT_FILENAME and + REQUEST_FILENAME cannot contain the full local filesystem + path since the path is unknown at this stage of processing. + Both variables will initially contain the value of REQUEST_URI + in that case. In order to obtain the full local filesystem + path of the request in per-server context, use an URL-based + look-ahead %{LA-U:REQUEST_FILENAME} to determine + the final value of REQUEST_FILENAME.

    4. %{ENV:variable}, where variable can be