asp.net-mvc – 阻止bingbot抓取我的网站
发布时间:2020-12-16 03:54:29 所属栏目:asp.Net 来源:网络整理
导读:我想完全阻止bing爬行我的网站(它以惊人的速度攻击我的网站(每月500GB的数据). 我有很多子域名添加到bing网站管理员工具,所以我不能去设置每个人的抓取速度. 我曾尝试使用robots.txt阻止它,但它无法正常工作 这是我的robots.txt # robots.txt User-agent: *D
我想完全阻止bing爬行我的网站(它以惊人的速度攻击我的网站(每月500GB的数据).
我有很多子域名添加到bing网站管理员工具,所以我不能去设置每个人的抓取速度. # robots.txt User-agent: * Disallow: Disallow: *.axd Disallow: /cgi-bin/ Disallow: /member Disallow: bingbot User-agent: ia_archiver Disallow: / 解决方法
这肯定会影响您的搜索引擎优化/搜索排名,并会导致页面从索引中删除,所以请小心使用
如果安装了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. UPDATE 看着你的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 – 使用回发解析.Net页面
- asp.net core 自定义异常处理中间件
- asp.net-mvc – 当前上下文中不存在’HttpClientFactory’
- AspNetCore.Authentication.JwtBearer失败,没有SecurityTok
- asp.net – 当我浮动列表元素时,为什么列表的背景颜色会消失
- asp.net-mvc-3 – 找不到视图’错误’或其主人
- asp.net – ModalPopupExtender和验证问题
- asp.net – 无法转换类型为’System.Web.UI.LiteralControl
- asp.net – 3层架构 – 需要一个例子
- asp.net – MVC 4数据注释“显示”属性
推荐文章
站长推荐
热点阅读