Oct 4, 2013

Apache: configure apache .htaccess to filter incomming request behind proxy

Normally we write we configure apache rewrite rule with underscore on every word separator. See below.

RewriteCond %{REMOTE_ADDR} 120.28.70.239
RewriteCond %{REQUEST_URI} phpinfo.php

For custom server variable made separated by dash(-) on every word and has a prefix of HTTP:. This mean to set X-FORWARDED-FOR see below.
RewriteCond %{HTTP:X-FORWARDED-FOR} 120.28.70.239

No comments: