我试图通过在“.htaccess”文件中阻止它们来过滤一些机器人,如下所示:
#UniversalRules
SetEnvIfNoCase User-Agent ^$ bad_bot #leave this for blank user-agents
SetEnvIfNoCase User-Agent .*\@.* bad_bot
SetEnvIfNoCase User-Agent .*bot.* bad_bot
但是这些规则也阻止了好的机器人,所以我在下面添加
#Goodbots
SetEnvIfNoCase User-Agent .*google.* good_bot
SetEnvIfNoCase User-Agent .*bingbot.* good_bot #bing
最后是阻塞规则
Order Allow,Deny
Allow from all
Deny from env=bad_bot
但是当我使用 GoogleBot useragent (Googlebot/2.1 (+ http://www.googlebot.com/bot.html ) 我得到 - 403 被禁止。
怎么了 ?