Forum Moderators: phranque

Message Too Old, No Replies

help with .htaccess

Deny from IP addresses

         

atomikjaff

10:43 am on Jul 9, 2009 (gmt 0)

10+ Year Member



Hi im a bit of a newbie, i recently put a comments php page on my website and its getting bombarded with the usual drug adverts. they are nearly all from the same ip address. when i initially tried to bar them using htaccess i managed to close the whole site down. whe i rewrote it the site runs but ipadresss that have been barred are still visiting. this is the .htaccess file as it reads now

# -FrontPage-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from 217.146.158.141
deny from 89.149.236.178
deny from 98.126.10.182
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

Can anyone help and tell me where ive gone wrong

thanks

jdMorgan

11:49 am on Jul 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



With the Order set to "Deny,Allow", "Allow from all" will override "Deny from nn" (see Apache mod_access documentation). I recommend that you delete the "Allow from all" in the first section.

Note that this does not stop the unwanted IP addresses from "visiting" and appearing in your log files. It will however, stop them from being able to GET your pages or POST to your comments form. All they will get will be a 403-Forbidden response.

Jim