.htaccess禁止IP或IP段访问

连续半个月了。。受够了几个IP段的流氓留言,决定把几个IP端拉入禁止访问列表

可以通过.htaccess作用来设置禁止访问的IP和IP段。

Order Allow,Deny
Deny from 92.241.169
Allow from all

.htaccess禁止IP
的话直接某个IP,禁止IP段
的话就是:Deny from 92.241.169。(92.241.169.1-92.241.169.254)

效果就是访问显示:

Forbidden

You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.