我现在希望完全阻止 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: /
关于asp.net-mvc - 阻止 bingbot 抓取我的网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27188531/