.htaccess url重写立即停止bingbot
我想立即停止bingbot 。 我想要在.htaccess中使用mod_rewrite来做到这一点。 我有这些规则… Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_USER_AGENT} ^bingbot/.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Bingbot/.* [OR] RewriteRule ^(.*)$ http://go.away/ [L] …但他们不工作。 我可以在我的日志中看到这种types的条目… msnbot-207-46-195-224.search.msn.com – – [11/Jul/2011:15:07:27 -0700] "GET /index.php?url_mainnav=13&url_subnav=131&url_expand=394,949,4631&url_startrow=110 HTTP/1.1" 403 502 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" …我已经尝试HTTP_USER_AGENT的正则expression式的多种变化,但我不能我想要的响应,所以我认为我使用的规则的实际结构是不正确的。 任何人都可以指向正确的方向吗? 顺便说一下,我知道这样的事情在iptables等方面做得好得多,我也知道robots.txt。 这是共享主机,所以我没有控制iptables,我不想等待bingbot六个/八小时重新读取robots.txt。 那么事情正在向前发展。 考虑到这个问题,我把重写规则改为: Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_USER_AGENT} ^bingbot/.* [OR,NC] RewriteCond %{HTTP_USER_AGENT} .*bingbot/.* [OR] […]