6月 23rd, 2009
让Apache拒绝网络流氓蜘蛛
Category: apache, 网站优化, Author: admin, Popularity: 52%1. 在配置文件里设置
打开httpd.conf编辑,将下列block如下编辑:
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Deny from 221.194.136.
Deny from 220.181.33.
2.使用BrowerMatchNoCase来过滤更有效
Apache 可以挡住特定 IP,但因为 robots 大多有多重 IP,过滤蜘蛛的名字的方法比较有效,可以用 BrowserMatchNoCase 来过滤,用法像是:
Order allow,deny
Allow from all
BrowserMatchNoCase “QihooBot” badguy
deny from env=badguy
如此,它们就会收到 Apache 发出 403 错误:Forbidden
3. .htaccess文件法
在网站根目录下建立或打开.htaccess文件,加入如下内容:
Order allow,deny
Allow from all
Deny from 221.194.136.
Deny from 220.181.33.
相关日志
Tags:deny, 蜘蛛, ip address, robots.
评论数量() | Add Comments
本文网址:http://www.9usb.net/200906/apache-robots.html