简体   繁体   中英

modified .htaccess file doesn't work with BrowserMatchNoCase

The servers (Ubuntu Server) it's going down because a 360Spider it's running too many request per seconds, I am trying to resolve this using this configuration in the .htaccess file:

BrowserMatchNoCase "360Spider" bots
BrowserMatchNoCase ^360Spider bots

Order Allow,Deny
Allow from ALL
Deny from env=bots

And works partially because the error.log logs some of this events:

[Sun Jul 20 23:30:15 2014] [error] [client 10.183.200.5] client denied by server configuration: /var/www/view, referer: http://www.mysite.org/

But the access.log it's still saving information about the 360Spider:

10.183.200.5 - - [20/Jul/2014:23:31:33 -0400] "GET /view/article/154967 HTTP/1.1" 403 536 "http://www.mysite.org/view/article/154967/" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0); 360Spider"

I want to block all that have the word 360Spider.

PD: I can't block the bot using the ip because all the traffic come with the same ip. I just can work with the .htaccess file.

Any IP Address, or bot going to a url/website will most likely make a GET request — Apache logs it . Just because you see it in the log does not mean it isn't blocked; Your access.log clearly shows that it is .

When the bot tried to GET /view/article/154967 it was denied ( 403 Forbidden ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM