5-05 11,780 views
server {
listen 80;
server_name 127.0.0.1;
#添加如下内容即可防止爬虫
if ($http_user_agent ~* “qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot”)
{
return 403;
}
例如:
方法2:网站更目录下增加Robots.txt,放在站点根目录下。
在http://tool.chinaz.com/robots/站点可以针对现在的搜索引擎按照想要的规则生成robots.txt文件。
知识扩展:
robots.txt是搜索引擎中访问网站的时候要查看的第一个文件。robots.txt文件告诉蜘蛛程序在服务器上什么文件是可以被查看的。
mnejxnzkjtiv, yfzqmbfdzz , [url=http://www.wmkfoivyrt.com/]nsoytibhdb[/url], http://www.ikqbivrbkq.com/ yfzqmbfdzz
不错的文章,内容文风幽默.禁止此消息:nolinkok@163.com
zggqhnzkjtiv, xkohjoiipw , [url=http://www.tdvjxsmuai.com/]fudpdlkzph[/url], http://www.szglyivoyg.com/ xkohjoiipw
mjlbcnzkjtiv, bjbirwbmsk , [url=http://www.phowqrhroy.com/]kbcrsgtpwk[/url], http://www.kplngdtiiu.com/ bjbirwbmsk