I
I
Ivan1462019-03-06 11:37:46
htaccess
Ivan146, 2019-03-06 11:37:46

How to block bots for clicking on a link?

Greetings. Studying the site server logs, I came across a large number of such entries that can potentially create a load on the site, and also spoil the statistics in the metric with bounces and their number (visiting the site by these bots is 0 seconds). Clients from the USA are determined by IP.

www.site.ru 18.206.180.185 - - [06/Mar/2019:08:26:03 +0300] "GET /includes/www.netflix.com/desktop/conta/index.php HTTP/1.1" 301 374 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36" 2160 0:0
www.site.ru 54.161.27.171 - - [06/Mar/2019:08:26:07 +0300] "GET /includes/www.netflix.com/desktop/conta HTTP/1.1" 301 351 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36" 1818 0:0
site.ru 54.175.209.189 - - [06/Mar/2019:05:02:42 +0300] "GET /index.php?_route_=includes/www.netflix.com/desktop/conta/ HTTP/1.1" 404 14033 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36" 110602 53333:19999
site.ru 54.196.24.167 - - [06/Mar/2019:02:00:36 +0300] "GET /index.php?_route_=includes/www.netflix.com/desktop/conta/index.php HTTP/1.1" 404 14035 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36" 120850 43333:33333

There is a pattern in the address of the appeal: netflix.com.
What code should I write in htaccess so that when accessing a link that contains the phrase "netflix.com" - block access to the site, as well as automatically ban the IP?
Is this the way I'm thinking? Maybe you can weed out this attack in another way?
UPDATE. So far I have made a ban on visiting a link that contains the word "netflix"
RewriteCond %{QUERY_STRING} netflix [NC]
RewriteRule ^.*$  - [F]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question