httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jsl...@gmail.com>
Subject Re: [users@httpd] mod_rewrite: Overwriting REMOTE_ADDR with HTTP_X_FORWARDED_FOR
Date Fri, 24 Jun 2005 13:49:14 GMT
On 6/24/05, Werner Schalk <werner_schalk@gmx.de> wrote:
> Hi,
> 
> I would like to use mod_rewrite to overwrite the environment variable
> REMOTE_ADDR with the value of HTTP_X_FORWARDED_FOR because I am using Apache
> 2 in a reverse / forward proxy scenario where the original IP address of the
> client is not passed on to the internal Apache server:

> I have posted this several weeks ago but all the solutions did not work for
> me. So I tried this mod_rewrite rule:

I already explained to you that you can't do this:
http://mail-archives.apache.org/mod_mbox/httpd-users/200506.mbox/%3ce498c166050615070734caf364@mail.gmail.com%3e
Is there some part of that you didn't understand?

> 
> RewriteEngine On
> RewriteRule ^(.*) [env=REMOTE_ADDR:%{HTTP_X_FORWARDED_FOR}]

This is broken because it is trying to rewrite to the URL "[env...". 
You need a dash after the patter to indicate that no rewriting will
occur.  But as I've already told you, it won't work anyway.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


Mime
View raw message