A new bot on my site

How would I block this France bot on my site “ahrefsbot”?

I looked at my logs and there’s multiple IP’s for this bot, so would be kind of hard to block by IP.

Thyanks

Would adding this work?

RewriteCond %{HTTP_USER_AGENT} ^AhrefsBot

I used

RewriteCond %{HTTP_USER_AGENT} AhrefsBot [NC,OR]

OK… Thanks… Stupid bots anyways…lol

Pain in the…

Well making that add isn’t stopping them… #-o

Post the log entry and .htaccess.

My htaccess file is attached. Here is 1 log entry from ahrefsbot. Hopefully this is what you were asking for.

[13/Apr/2017:00:00:20 -0400] “GET /wxLSRreports.php?i=IND&p=39 HTTP/1.1” 200 62170 www.northbendweather.com “-” “Mozilla/5.0 (compatible; AhrefsBot/5.2; +http://ahrefs.com/robot/)” “-”
144.76.22.40


htaccess.txt (3.63 KB)

Your not telling it what to do if that rule is met, and you don’t need the OR if it’s the last or only condition. Try

RewriteCond %{HTTP_USER_AGENT} AhrefsBot [NC]
RewriteRule ^.* - [F,L]

P.S. You’ll still see them in the log, but with a 403 rejection code rather than a 200 code.

That worked, thanks.