Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 44442 invoked by uid 500); 20 Jan 2003 17:31:16 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 44290 invoked from network); 20 Jan 2003 17:31:13 -0000 Received: from boost.horde.net (216.42.80.181) by daedalus.apache.org with SMTP; 20 Jan 2003 17:31:13 -0000 Received: by boost.horde.net (Postfix, from userid 100) id E0FCC14060; Mon, 20 Jan 2003 12:31:15 -0500 (EST) Date: Mon, 20 Jan 2003 12:31:15 -0500 From: John Morrissey To: users@httpd.apache.org Message-ID: <20030120173115.GA19713@boost.horde.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Marks: The Spot X-Echelon-This: InfoSec, Encryption, Defcon, Marx X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: [users@httpd] Apache2: mod_rewrite and %{REQUEST_FILENAME} 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 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). After judicious cursing and hair-pulling, 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. Is this a bug in the docs, mod_rewrite, or am I just blowing hot air? thanks! john -- John Morrissey _o /\ ---- __o jwm@horde.net _-< \_ / \ ---- < \, www.horde.net/ __(_)/_(_)________/ \_______(_) /_(_)__ --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org