apache禁止网络爬虫

Apache中禁止网络爬虫,之前设置了很多次的,但总是不起作用,原来是是写错了,不能写到Dirctory中,要写到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 SetEnvIfNoCase User-Agent "spider" bad_bot 这是禁止了所有包含spider字符的爬虫。 如果要针对性的禁止爬虫,改成精确匹配的爬虫字符串,如果bingbot、Googlebot等等

转载于:https://my.oschina.net/766/blog/210883

猜你喜欢

转载自blog.csdn.net/weixin_34406061/article/details/91546096