Block referrals from server IP address
4 posts
• Page 1 of 1
- philiporeilly
-
- Posts: 4
- Joined: 20 Aug 2012, 22:36
Block referrals from server IP address
I'm looking for help to create a rule to block referrals to my website from a specific IP address. I am able to create a rule to block redirects from a specific domain hostname but now I need to block a fixed IP address. We have a nasty domain name redirecting to our site and I was able to block the referrals from that hostname. Now they are redirecting that domain to a fixed IP which then redirects back to our site.
my conditions for the hostname was
this doesn't work for a referring server ip address which is sending 302 redirects.
Any help appreciated!
my conditions for the hostname was
- Code: Select all
RewriteCond %{HTTP_REFERER}domain\.com[NC]
this doesn't work for a referring server ip address which is sending 302 redirects.
Any help appreciated!
Re: Block referrals from server IP address
Hello, Philip
Here's what should be used:
RewriteCond %{REMOTE_ADDR} ^203\.20\.65\.29$
RewriteRule .? - [F]
Here's what should be used:
RewriteCond %{REMOTE_ADDR} ^203\.20\.65\.29$
RewriteRule .? - [F]
- philiporeilly
-
- Posts: 4
- Joined: 20 Aug 2012, 22:36
Re: Block referrals from server IP address
Hi Anton
Thanks for the reply but that solution will block requests from that IP as the remote address. I need to block traffic being referred from that IP address. For example my host machine visits that IP address and is redirected to my web server. The requests will come from my host machine but referred from that IP.
Any help would be appreciated if this is possible at all,
Thanks again,
Philip
Thanks for the reply but that solution will block requests from that IP as the remote address. I need to block traffic being referred from that IP address. For example my host machine visits that IP address and is redirected to my web server. The requests will come from my host machine but referred from that IP.
Any help would be appreciated if this is possible at all,
Thanks again,
Philip
Re: Block referrals from server IP address
Hello, Philip
The thing is that browser doesn't deliver this information. The only field is Referer and it sometimes contains host. You could try to resolve the IP address using the hostname on your server, but ISAPI_Rewrite can't do that and it may be rather slow.
The thing is that browser doesn't deliver this information. The only field is Referer and it sometimes contains host. You could try to resolve the IP address using the hostname on your server, but ISAPI_Rewrite can't do that and it may be rather slow.
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 12 guests