我现在不想完全阻止bing爬网(它以惊人的速度(每月500GB数据)攻击我的网站。

我将1000个子域添加到bing网站管理员工具中,因此我无法设置每个人的抓取速度。
我尝试使用robots.txt阻止它,但是它不起作用
这是我的robots.txt

# robots.txt
User-agent: *
Disallow:
Disallow: *.axd
Disallow: /cgi-bin/
Disallow: /member
Disallow: bingbot
User-agent: ia_archiver
Disallow: /

最佳答案

这肯定会影响您的SEO/搜索排名,并且会导致页面从索引中删除,因此请谨慎使用

如果您安装了iis重写模块,则可以基于用户代理字符串阻止请求(如果不使用here,则可以)

然后将规则添加到您的webconfig中,如下所示:

<system.webServer>
  <rules>
    <rule name="Request Blocking Rule" stopProcessing="true">
      <match url=".*" />
      <conditions>
        <add input="{HTTP_USER_AGENT}" pattern="msnbot|BingBot" />
      </conditions>
      <action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this page." />
    </rule>
  </rules>
</system.webServer>

如果漫游器访问您的网站,则会返回403。

更新

查看您的robots.txt,我认为应该是:
# robots.txt
User-agent: *
Disallow:
Disallow: *.axd
Disallow: /cgi-bin/
Disallow: /member
User-agent: bingbot
Disallow: /
User-agent: ia_archiver
Disallow: /

07-28 02:50
查看更多