Unable to block IP Address in .htaccess

Avatar
  • Answered
I'm hoping you can help me here...
For various reasons there are a lot of IP addresses I block from my websites here on inMotion. I frequently block IP ranges.

My sites are frequently hit hard by the IP address 72.21.217.64 - generating hoards of 403s - and while I have blocked the range, they still come through.. (This goes for many IPs I'm just mentioning one)

Ive tried blocking their User agent as well to no avail.
RPT-HTTPClient/0.3-3

How can I ban these bozos?
Avatar
anonymous
Hello Kdawes01,

Even if it is being blocked it will show up. Lets take this snippet as an example:

72.21.217.139,-,-,[17/Jul/2015:10:42:35 --0700],"GET /sal/wp-content/uploads/2015/06/image001-191x300-191x300.jpg HTTP/1.1",403,102,United States,-,RPT-HTTPClient/0.3-3

So the request came from 72.21.217.139 on 17/Jul/2015:10:42:35 requesting /sal/wp-content/uploads/2015/06/image001-191x300-191x300.jpg using protocol HTTP/1.1 of which the server replied with a 403 error (blocked by configuration). If you wanted to block this IP prior to getting to Apache then you would need to block it in the firewall.

Best Regards,
TJ Edens
Avatar
JeffMa
Generally, blocking can be done directly in cPanel using the IP Deny Manager which would simply modify your .htaccess file, but it is possible that the ability to do so is being inhibited by other content. To do so, you may simply block the IP manually within your .htaccess file using the following line:

Order Deny,Allow Deny from 123.123.123.123

Best regards, JeffMa