View Single Post
  #1   IP: 61.139.126.97
Old 2006-10-18, 12:51 AM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default Block IP addresses from my site?

Quote:
Can I block certain IP addresses from seeing my website?
Yes, you can block certain IP addresses from accessing your site by using a Deny directive in an .htaccess file.

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

For example, if you put the following .htaccess file in a directory, then it would operate on all directories beneath it:
Quote:
Deny from evil-person.attbi.com
Deny from 51.128.65.62
Deny from 207.51.29
The first Deny directive would block the exact host mentioned. The second Deny would block the exact IP address 61.128.65.62. The third directive would block all IP addresses fitting the pattern 207.51.29.anything.
Reply With Quote