我应该使用什么.htaccess rewriterule来检测已知机器人,例如大机器人:
altavista,google,bing,yahoo
我知道我可以检查他们的ips或主机,但是有更好的方法吗?
答案 0 :(得分:3)
RewriteCond %{HTTP_USER_AGENT} AltaVista [OR]
RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
RewriteCond %{HTTP_USER_AGENT} Slurp
RewriteRule ^.*$ IHateBots.html [L]