Forum Moderators: buckworks

Message Too Old, No Replies

Block IP address in .htaccess ?

         

olimits7

3:04 pm on Jul 15, 2009 (gmt 0)

10+ Year Member



Hi,

I'm trying to block an IP address (which I think is spam), and I used the below format in my .htaccess but I still see the IP address listed on my site from my admin view.

<Limit GET POST>
order deny,allow
deny from all
deny from 64.27.0.41
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
deny from 64.27.0.41
</Limit>

Does anyone know why the IP address I blocked is still being shown in admin?

Do I have to restart the Apache service before the IP address block works?

Thank you,

olimits7

jdMorgan

3:20 pm on Jul 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You have specified that allows override denies, so nothing is blocked for GET or POST. See the Apache mod_access documentation.

Even after correcting your code, the denied client will still connect and get logged. The important factor is your server's response code: If the IP is blocked, it will be a 403-Access Forbidden. If it is not blocked, you'll see a different response code, e.g. 200-OK, 304-Not Modified, etc.

Look at your raw server access logs if you want to see a detailed, accurate picture of the transaction.

Any code placed into .htaccess takes effect as soon as that .htaccess file is uploaded. If the code is in a server config file such as httpd.conf, the server will have to be restarted for it to take effect.

Jim