You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2003/01/24 19:29:44 UTC

DO NOT REPLY [Bug 16402] New: - %{REQUEST_FILENAME} needs lookahead in order to contain local path instead of URI

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16402>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16402

%{REQUEST_FILENAME} needs lookahead in order to contain local path instead of URI

           Summary: %{REQUEST_FILENAME} needs lookahead in order to contain
                    local path instead of URI
           Product: Apache httpd-2.0
           Version: 2.0.44
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: mod_rewrite
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: jwm@horde.net


I'm running Apache2 (2.0.43) and wanted to transparently send requests for
PHP-processed files to an Apache1.3 instance, which runs PHP Accelerator
(www.php-accelerator.co.uk). Naturally, I turned to mod_proxy and mod_rewrite.
However, I (think I've) found a problem with either the docs or with mod_rewrite
itself. Here's the ruleset I tried:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteRule ^/+(.*)$ http://otherhost.horde.net/$1 [P,NE,L]

Turning on a RewriteLog showed that %{REQUEST_FILENAME} contained the URI of the
request, not the full local path as stated in the mod_rewrite docs
(http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html). However, I found that
this ruleset works:

RewriteEngine on
RewriteCond %{LA-U:REQUEST_FILENAME} \.php$
RewriteRule ^/+(.*)$ http://otherhost.horde.net/$1 [P,NE,L]

In order to get the full local path in %{REQUEST_FILENAME}, you have to force
mod_rewrite to do a look-ahead with %{LA-U:REQUEST_FILENAME}.

The kicker is that the docs go on at length about the difference between
REQUEST_URI and REQUEST_FILENAME. I found these variables to be identical unless
you force mod_rewrite to look ahead for REQUEST_FILENAME. I posted to
apache-users, but didn't get any response after a few days and this doesn't seem
to be reported already. Is this a bug in the docs, mod_rewrite, or am I just
blowing hot air?

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org