you can block certain IP addresses from accessing
your site by using a Deny
directive in an .htaccess file. You can restrict this to the whole
site or to some directories.
The Apache documentation explains how to do this:
http://httpd.apache.org/docs/mod/mod_access.html
http://httpd.apache.org/docs/howto/auth.html
Example, if you put the following .htaccess file in a directory, then it would operate on all directories beneath it:
Deny from 202.30.166.123
Deny From 202.30.160
The 1st Deny directive would block the exact IP address 202.30.166.123. The 2nd Deny directive would block all IP addresses fitting the pattern 202.30.160, including 202.30.160.1, 202.30.160.2,... 202.30.160.254, etc.
You can also add the "Deny from" into a
<Directory> directive in your httpd.conf if you have a
dedicated server hosted with us.
|