使用 htaccess apache 重定向所有机器人 [英] redirect all bots using htaccess apache
本文介绍了使用 htaccess apache 重定向所有机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我应该使用什么 .htaccess rewriterule 来检测已知的机器人,例如大型机器人:
What .htaccess rewriterule should i use to detect known bots, for example the big ones:
altavista、谷歌、必应、雅虎
我知道我可以检查他们的 ip 或主机,但有没有更好的方法?
I know i can check for their ips, or hosts, but is there a better way?
推荐答案
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]
这篇关于使用 htaccess apache 重定向所有机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文