Forum Moderators: phranque

Message Too Old, No Replies

Refusing to answer HTTP requests from a specific IP

How to block an IP, not even sending a 403

         

Orbite

4:29 am on Dec 13, 2004 (gmt 0)

10+ Year Member



I'm searching for a way of not answering requests from the a robot coming from 217.**.99.100 .

I already block this IP with an .htaccess, sending an 403 Forbiden Access answer each time it asks for a page. But, instead, I would like to completely ignore requests from that robot as if my server wasn't online.

Can this be done? If yes, how?

[edited by: jdMorgan at 7:01 am (utc) on Dec. 13, 2004]
[edit reason] Removed specifics per TOS [/edit]

jdMorgan

7:05 am on Dec 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can's do it internal to Apache, but you could add an entry in your firewall (or in your router with firewall functionality) to completely block it. If you are on a hosted account and this 'bot is causing real problems for you site, then ask your host to block that IP range.

If you just want to limit the bandwidth wasted in 403ing this 'bot, then redirect it to a subdirectory with a zero-byte custom 403 error page in it. This will limit the response bandwidth to whatever server response headers your server is configured to return, but with a content-body length of zero.

Jim

Orbite

7:37 am on Dec 13, 2004 (gmt 0)

10+ Year Member



I will contact my server host first thing tomorrow morning. In the meanwhile, I'll feed this spider with an empty 403 to reduce bandwidth consumption.

Thank you for your help and suggestions.