asp.net-mvc - 阻止 bingbot 抓取我的网站

标签 asp.net-mvc .htaccess bots robots.txt bing

我现在希望完全阻止 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/

相关文章:

ruby-on-rails - cucumber - 步骤结束后出现服务器错误

javascript - 至尊机器人上的无限循环

asp.net-mvc - 如何创建 3D 饼图? -Asp.net MVC

c# - 为什么我的 Azure 中托管的 ASP NET Web 服务没有执行任何操作?

php - 如何使用 PHP 和 mySql 为用户配置文件创建单独的 Web 页面?网址重写?

javascript - 在discord.js 中添加日期时间描述

asp.net-mvc - 在 Odata 查询的 $expand 中使用 $filter

c# - 日期时间并不总是得到设置

regex - Apache .htaccess <此处不允许使用目录

html - 使用 htaccess 处理 DDos?