From: Eric Covener Other things you should be aware of: The variables SCRIPT_FILENAME and REQUEST_FILENAME
contain the same value - the value of the
REQUEST_FILENAME
REQUEST_FILENAME
is referenced. Otherwise,
+ such as when used in virtual host context, the same
+ value as REQUEST_URI
.
HTTPS
-
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
).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.
%{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
REQUEST_FILENAME
is referenced. Otherwise,
+ such as when used in virtual host context, the same
+ value as REQUEST_URI
.
HTTPS
Other things you should be aware of:
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
).
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.
%{ENV:variable}
, where variable can be