[TriLUG] Working with headers in apache

Marc Wiatrowski mwia at iglass.net
Fri Nov 7 11:42:07 EST 2008


On Thu, 2008-11-06 at 21:56 -0500, Steve Hoffman wrote:
> Hello all,
> I have a question that hopefully someone here can help with...a web user is
> redirected from a third party site with a few headers set by that third
> party, the most important of which is userType.  what I would like to do is
> (with apache working as a reverse proxy) inspect the headers as they pass
> through and if userType=S && sourceIP!=10.0.0.0/24 throw a custom error
> page.
> 

What about something like this? (not tested at all)

RewriteEngine On
RewriteCond %{HTTP:userType} ^S$
RewriteCond %{REMOTE_ADDR} !^10\.0\.0\. 
RewriteRule ^/.*  /error.html  [L]

marc





More information about the TriLUG mailing list