基于这些
https://www.projecthoneypot.org/ip_46.229.164.98 https://www.projecthoneypot.org/ip_46.229.164.98
https://www.projecthoneypot.org/ip_46.229.164.100 https://www.projecthoneypot.org/ip_46.229.164.100
https://www.projecthoneypot.org/ip_46.229.164.101 https://www.projecthoneypot.org/ip_46.229.164.101
it looks就像机器人一样http://www.semrush.com/bot.html http://www.semrush.com/bot.html
如果那真的是机器人,他们在他们的页面上说
To remove our bot from crawling your site simply insert the following lines to your
"robots.txt" file:
User-agent: SemrushBot
Disallow: /
当然,这并不能保证机器人会遵守规则。您可以通过多种方式阻止他。 .htaccess 就是其中之一。就像你做的那样。
你也可以做这个小技巧,拒绝任何在用户代理字符串中包含“SemrushBot”的 IP 地址
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
SetEnvIfNoCase User-Agent "^SemrushBot" bad_user
SetEnvIfNoCase User-Agent "^WhateverElseBadUserAgentHere" bad_user
Deny from env=bad_user
这种方式将阻止机器人可能使用的其他 IP。
查看有关通过用户代理字符串阻止的更多信息:https://stackoverflow.com/a/7372572/953684 https://stackoverflow.com/a/7372572/953684
我应该补充一点,如果你的网站被蜘蛛关闭了,usually这意味着你的脚本写得不好或者服务器很弱。
edit:
这条线
SetEnvIfNoCase User-Agent "^SemrushBot" bad_user
尝试匹配如果用户代理开始于字符串SemrushBot
(插入符号^
意思是“开始于”)。如果你想搜索的话SemrushBot
在 User-Agent 字符串中的任何位置,只需删除插入符号即可变为:
SetEnvIfNoCase User-Agent "SemrushBot" bad_user
上面的意思是如果 User-Agent 包含字符串SemrushBot
任何地方(是的,不需要.*
).