开发者

redirect all bots using htaccess apache

开发者 https://www.devze.com 2022-12-28 00:35 出处:网络
What .htaccess rewriter开发者_JS百科ule should i use to detect known bots, for example the big ones:

What .htaccess rewriter开发者_JS百科ule 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]
0

精彩评论

暂无评论...
验证码 换一张
取 消