重定向htaccess的使用Apache的所有漫游 [英] redirect all bots using htaccess apache

查看:195
本文介绍了重定向htaccess的使用Apache的所有漫游的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么的.htaccess重写规则,我应该用它来检测已知的机器人,例如大的:

AltaVista的,谷歌,必应,雅虎

我知道我可以检查自己的IPS,或者主机,但有没有更好的办法?

解决方案

 的RewriteCond%{HTTP_USER_AGENT} AltaVista的[OR]
的RewriteCond%{HTTP_USER_AGENT} Googlebot的[OR]
的RewriteCond%{HTTP_USER_AGENT} MSNBot会[OR]
的RewriteCond%{HTTP_USER_AGENT}思乐普
重写规则^ * $ IHateBots.html [L]
 

What .htaccess rewriterule should i use to detect known bots, for example the big ones:

altavista, google, bing, yahoo

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆