Forum Moderators: phranque

Message Too Old, No Replies

IP based blocking with .htaccess

         

scatrbrain

9:35 am on Mar 5, 2005 (gmt 0)

10+ Year Member



Hi, im fairly new to using .htaccess files and im a bit confused about something. I have set up a .htaccess file to do IP based blocking. This seems to work about 99% of the time, but some people still slip through for some reason. I do understand that when blocking by host name, if the host name can not be resolved it will not stop people, but is this the same way for IP addresses? I have tried blocking a couple people by single IP address, and when that didn't work I tried something like 64.136.* and that wont stop them.
This is what an example of what im using in the .htaccess

<Limit GET POST>
order allow,deny
allow from all
deny from 64.136.0.0
</Limit>

Any advice would be appreciated. Thanks.

coopster

12:21 pm on Mar 5, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, scatrbrain.

Don't use the asterisk for a partial IP address range [httpd.apache.org]. As you have no doubt discovered, the Order [httpd.apache.org] directive is also very important.


Deny,Allow
The Deny [httpd.apache.org] directives are evaluated before the Allow [httpd.apache.org] directives. Access is allowed by default. Any client which does not match a Deny [httpd.apache.org] directive or does match an Allow [httpd.apache.org] directive will be allowed access to the server.

<Limit GET POST> 
order allow,deny
allow from all
deny from 64.136.
</Limit>

What other neat stuff can I do? [httpd.apache.org]

scatrbrain

7:09 pm on Mar 5, 2005 (gmt 0)

10+ Year Member



coopster thanks for the welcome and your reply.. I have learned a lot from webmasterworld.

Thanks again!