Problem using look-ahead in httpd mod_rewrite
Issue
After migrating from Apache 1.3 on HPUX to Apache 2.2 on RHEL 5.4, mod_rewrite no longer works as per the documentation.
The rewrite rule that looks like:
RewriteRule ^/(.*)$ http://62.44.157.13/$1?user=%{LA-U:REMOTE_USER}&ip=%{REMOTE_ADDR} [P,QSA,L]
On Apache 1.3 the lookahead is done correctly, but on 2.2 the rewrite log looks like:
192.168.20.200 - - [24/Nov/2009:14:18:35 +0100] [62.44.158.58/sid#8bf9928][rid#8cc4958/initial\] (5) lookahead: path=/NewImages/TM_PETRIX-E_Foot_Forside.gif var=REMOTE_USER -> val=
192.168.20.200 - - [24/Nov/2009:14:18:35 +0100] [62.44.158.58/sid#8bf9928][rid#8cc4958/initial\] (2) rewrite '/NewImages/TM_PETRIX-E_Foot_Forside.gif' -> 'http://62.44.157.13/NewImages/TM_PETRIX-E_Foot_Forside.gif?user=&ip=192.168.20.200'
192.168.20.200 - - [24/Nov/2009:14:18:35 +0100] [62.44.158.58/sid#8bf9928][rid#8cc4958/initial\] (3) split uri=http://62.44.157.13/NewImages/TM_PETRIX-E_Foot_Forside.gif?user=&ip=192.168.20.200 -> uri=http://62.44.157.13/NewImages/TM_PETRIX-E_Foot_Forside.gif, args=user=&ip=192.168.20.200
192.168.20.200 - - [24/Nov/2009:14:18:35 +0100] [62.44.158.58/sid#8bf9928][rid#8cc4958/initial\] (2) forcing proxy-throughput with http://62.44.157.13/NewImages/TM_PETRIX-E_Foot_Forside.gif
192.168.20.200 - - [24/Nov/2009:14:18:35 +0100] [62.44.158.58/sid#8bf9928][rid#8cc4958/initial\] (1) go-ahead with proxy request proxy:http://62.44.157.13/NewImages/TM_PETRIX-E_Foot_Forside.gif [OK]
Environment
- Red Hat Enterprise Linux 5.4
- Apache 2.2
- mod_rewrite
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
