问:不明蜘蛛爬取网站消耗流量占比较多,看了相关教程仍然无法处理,请帮忙禁止以下红框内的三种蜘蛛的爬取,感谢。
,请帮助我的网站禁止不明蜘蛛爬取
答:您好,
这种不规则蜘蛛,无法通过规则的方式拦截,您可以关闭ssl 部署,然后开启百度云加速,百度云加速的缓存机制可以缓存静态文件,从而节 流量消耗。
问:我需要ssl。帮忙想想其他办法,谢谢。
答:您好,可尝试开启只让允许的蜘蛛进行访问,对于允许范围之外的蜘蛛进行拦截操作,请知悉
可在虚拟主机下/www目录下创建一个web.config(已有该文件,可直接在该文件中进行修改),在该文件中添加:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Block spider">
<match url="(^robots.txt$)" ignoreCase="false" negate="true" />
<conditions>
<add input="{HTTP_USER_AGENT}" pattern="SemrushBot|Webdup|AcoonBot|AhrefsBot|Ezooms|EdisterBot|EC2LinkFinder|jikespider|Purebot|MJ12bot|WangIDSpider|WBSearchBot|Wotbox|xbfMozilla|Yottaa|YandexBot|Jorgee|SWEBot|spbot|TurnitinBot-Agent|curl|perl|Python|Wget|Xenu|ZmEu" ignoreCase="true" />
</conditions>
<action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
将要拦截的蜘蛛信息添加到{HTTP_USER_AGENT}中即可,以“|”进行分隔,请知悉
,非常感谢您长期对我司的支持!