屏蔽国外垃圾蜘蛛方法大全
发布时间:2024-01-04 栏目:建站知识
浏览:
分类:
屏蔽国外垃圾蜘蛛的方法有很多,以下是一些常见的方法: 1. 使用robots.
Robots.txt屏蔽方法
robots.txt方法只支持那些遵守robots.txt规则的蜘蛛,很多垃圾蜘蛛并不看这个,所以不是100%有用。
User-agent:SemrushBotDisallow:/User-agent:DotBotDisallow:/User-agent:MJ12botDisallow:/User-agent:AhrefsBotDisallow:/User-agent:MauiBotDisallow:/User-agent:MegaIndex.ruDisallow:/User-agent:BLEXBotDisallow:/User-agent:ZoominfoBotDisallow:/User-agent:ExtLinksBotDisallow:/User-agent:hubspotDisallow:/User-agent:leikiDisallow:/User-agent:webmeupDisallow:/User-agent:GooglebotDisallow:/User-agent:googlebot-imageDisallow:/User-agent:googlebot-mobileDisallow:/User-agent:yahoo-mmcrawlerDisallow:/User-agent:yahoo-blogs/v3.9Disallow:/User-agent:SlurpDisallow:/User-agent:twicelerDisallow:/User-agent:AhrefsBotDisallow:/User-agent:psbotDisallow:/User-agent:YandexBotDisallow:/
nginx屏蔽方法
以下代码添加到Nginx配置文件内,判断蜘蛛的UA标识,真就返回403
#屏蔽垃圾蜘蛛if($http_user_agent~*(SemrushBot|DotBot|MJ12bot|AhrefsBot|MauiBot|MegaIndex.ru|BLEXBot|ZoominfoBot|ExtLinksBot|hubspot|leiki|webmeup)){return403;}