咨询热线:4006-75-4006
售前:9:00-23:30 备案:9:00-18:00 技术:7*24h
Apache中禁止网络爬虫,之前设置了很多次的,但总是不起作用,原来是是写错了,不能写到Dirctory中,要写到Location中
1 2 3 4 5 6 7 8 9 | <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> |
1 | SetEnvIfNoCase User-Agent "spider" bad_bot |
这是禁止了所有包含spider字符的爬虫。
如果要针对性的禁止爬虫,改成精确匹配的爬虫字符串,如果bingbot、Googlebot等等