Block IP based off Header

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 2
Joined: 28 Mar 2013, 11:13

Block IP based off Header

28 Mar 2013, 11:21

I'm trying to block access based off the header HTTP_X_FORWARDED_FOR

So if I have a value
HTTP_X_FORWARDED_FOR:11.11.48.55, 112.123.133.200, 192.1.122.52, 79.11.12.33

How can I block all access to my site.
I tried something like this but it doesn't seem to be working
RewriteCond %{HTTP:X_FORWARDED_FOR} 11\.11\.48\.55 / [NC,F,O]

Thank you for your help

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Block IP based off Header

28 Mar 2013, 12:03

Hello,


Try using the following:

Code: Select all
RewriteCond %{HTTP_X_FORWARDED_FOR} 11\.11\.48\.55
RewriteRule .* - [F]


Regards
Andrew

User avatar
Posts: 2
Joined: 28 Mar 2013, 11:13

Re: Block IP based off Header

28 Mar 2013, 13:18

Perfect that worked, thank you for your help.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 14 guests