You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2010/02/22 18:47:45 UTC
svn commit: r914981 - in /httpd/httpd/branches/2.2.x/docs/manual/mod:
mod_rewrite.html.en mod_rewrite.xml
Author: covener
Date: Mon Feb 22 17:47:44 2010
New Revision: 914981
URL: http://svn.apache.org/viewvc?rev=914981&view=rev
Log:
clarification on REQUEST_FILENAME vs per-vhost Rewrite directives.
backport of r914980 and partial backport r728399 (Bob Ionescu)
Modified:
httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.html.en
httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.xml
Modified: httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.html.en?rev=914981&r1=914980&r2=914981&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.html.en (original)
+++ httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.html.en Mon Feb 22 17:47:44 2010
@@ -393,7 +393,11 @@
<dt><code>REQUEST_FILENAME</code></dt>
<dd>The full local filesystem path to the file or
- script matching the request.</dd>
+ script matching the request, if this has already
+ been determined by the server at the time
+ <code>REQUEST_FILENAME</code> is referenced. Otherwise,
+ such as when used in virtual host context, the same
+ value as <code>REQUEST_URI</code>.</dd>
<dt><code>HTTPS</code></dt>
@@ -410,14 +414,25 @@
<p>Other things you should be aware of:</p>
<ol>
- <li>The variables SCRIPT_FILENAME and REQUEST_FILENAME
+ <li><p>The variables SCRIPT_FILENAME and REQUEST_FILENAME
contain the same value - the value of the
<code>filename</code> field of the internal
<code>request_rec</code> 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
- <code>uri</code> field of <code>request_rec</code>).</li>
+ <code>uri</code> field of <code>request_rec</code>).</p>
+ <p>If a substitution occurred and the rewriting continues,
+ the value of both variables will be updated accordingly.</p>
+ <p>If used in per-server context (<em>i.e.</em>, 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 <code>%{LA-U:REQUEST_FILENAME}</code> to determine
+ the final value of REQUEST_FILENAME.</p></li>
<li>
<code>%{ENV:variable}</code>, where <em>variable</em> can be
Modified: httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.xml?rev=914981&r1=914980&r2=914981&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.xml (original)
+++ httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.xml Mon Feb 22 17:47:44 2010
@@ -794,7 +794,11 @@
<dt><code>REQUEST_FILENAME</code></dt>
<dd>The full local filesystem path to the file or
- script matching the request.</dd>
+ script matching the request, if this has already
+ been determined by the server at the time
+ <code>REQUEST_FILENAME</code> is referenced. Otherwise,
+ such as when used in virtual host context, the same
+ value as <code>REQUEST_URI</code>.</dd>
<dt><code>HTTPS</code></dt>
@@ -811,14 +815,25 @@
<p>Other things you should be aware of:</p>
<ol>
- <li>The variables SCRIPT_FILENAME and REQUEST_FILENAME
+ <li><p>The variables SCRIPT_FILENAME and REQUEST_FILENAME
contain the same value - the value of the
<code>filename</code> field of the internal
<code>request_rec</code> 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
- <code>uri</code> field of <code>request_rec</code>).</li>
+ <code>uri</code> field of <code>request_rec</code>).</p>
+ <p>If a substitution occurred and the rewriting continues,
+ the value of both variables will be updated accordingly.</p>
+ <p>If used in per-server context (<em>i.e.</em>, 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 <code>%{LA-U:REQUEST_FILENAME}</code> to determine
+ the final value of REQUEST_FILENAME.</p></li>
<li>
<code>%{ENV:variable}</code>, where <em>variable</em> can be