I have an apache server running WordPress, and recently I noticed large traffic from a spam bot more specifically bot-traffic.xyz which shows in the "Top Referrals" section when looking at Google Analytics. My question is since I don't know the source IP address, how do I block the spam bot using the .htaccess? I have found a post (https://moz.com/blog/how-to-stop-spam-bots-from-ruining-your-analytics-referral-data) pointing out the process, but I'm not sure since it's from 2015. The post says to do something like this:
RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://.*domain1\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*domain2\.com/ [NC]
RewriteRule ^(.*)$ – [F,L]
If this is correct, how would I block bot-traffic.xyz? Can some describe what the above code is?
Thanks,