avoid bots hitting server apache2 code example
Example: avoid bots hitting server apache2
<Directory /var/www/html>
#Header set Access-Control-Allow-Origin "*"
BrowserMatchNoCase "Baiduspider" bots
BrowserMatchNoCase "HTTrack" bots
BrowserMatchNoCase "Yandex" bots
BrowserMatchNoCase "AhrefsBot" bots
BrowserMatchNoCase "exabot" bots
BrowserMatchNoCase "MJ12bot" bots
BrowserMatchNoCase "dotbot" bots
BrowserMatchNoCase "gigabot" bots
BrowserMatchNoCase "Visbot" bots
BrowserMatchNoCase "SemrushBot" bots
BrowserMatchNoCase "SpammerRobot" bots
BrowserMatchNoCase "SecurityHoleRobot" bots
Options Indexes FollowSymLinks
AllowOverride none
Order allow,deny
Allow from all
Deny from env=bots
Require all granted