如何阻止不包括爬虫的机器人访问我的网站?

How to block Bots excluding crawlers from accessing my site?

机器人每隔几分钟或几小时就会抓取我的网站,由于资源短缺,我的网站变得不可用。该机器人起源于 俄罗斯

如何阻止此机器人访问我的网站?

拒绝指令应该在文件部分内,尝试:

<Files 403.shtml>
order allow,deny
allow from all
deny from xxx.xxx.xx.xxx
</Files>

或者,您可以使用 mod-rewrite based ip blocking

RewriteEngine on

RewriteCond %{REMOTE_ADDR} ^1\.2\.3\.4\.5$
RewriteRule  - [F]

我已经解决了他的问题。

解决方法:

检查您域的最新访问者 检查持续访问的用户代理。

就我而言,我发现 YandexBot

Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)

既然您已经找到了正在降低服务器速度的 bot,请继续阻止它。您可以使用 robots.txt.htaccess

.htaccess方法:

在其中添加以下代码。

#block bad bots with a 403
BrowserMatchNoCase "Yandex" bots
Order Allow,Deny
Allow from ALL
Deny from env=bots

robots.txt方法:

在其中添加以下代码。

User-agent: Yandex
Disallow: /

就是这样。您已阻止该机器人。