HTTP_X_FORWARDED_FOR

Topics: Developer Forum
Oct 3, 2010 at 4:27 PM

Hi, is there a way to rewrite the REMOTE_ADDR header, for the value in HTTP_X_FORWARDED_FOR if its not empty?

This way my app will get the correct IP when people are using proxies.

Dave

Coordinator
Oct 4, 2010 at 1:04 PM
There may be a way to do what you want using a RewriteHeader, and some associated RewriteCond statements. If I were you I would read the HTTP specification, RFC 2616, to see if what you plan to do is legal and compliant. It seems questionable to me. Good luck.