kavin

apache禁止网络爬虫采集

kavin apache 2018-05-05 2735浏览 0

Apache中禁止网络爬虫,不能写到Dirctory中,要写到Location中


<Location />

SetEnvIfNoCase User-Agent "spider" bad_bot

BrowserMatchNoCase bingbot bad_bot

BrowserMatchNoCase Googlebot bad_bot

Order Deny,Allow

#下面是禁止soso的爬虫

Deny from 124.115.4. 124.115.0. 64.69.34.135 216.240.136.125 218.15.197.69 155.69.160.99 58.60.13. 121.14.96. 58.60.14. 58.61.164. 202.108.7.209

Deny from env=bad_bot

</Location>



SetEnvIfNoCase User-Agent "spider" bad_bot    这是禁止了所有包含spider字符的爬虫。


如果要针对性的禁止爬虫,改成精确匹配的爬虫字符串,如果bingbot、Googlebot等等

继续浏览有关 网络爬虫 的文章
发表评论