How To Block Bad Bots For Hostgator Via .htaccess

How to use .htaccess to block the bad bots for Hostgator server

First, you need to find out the keywords of user agents of bad bots and use RewriteRule to block any visitor which hold those keywords from their user agents.

e.g for bots – YandexBot and SiteExplorer

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_USER_AGENT} (YandexBot|SiteExplorer) [NC]
    RewriteRule (.*) - [F,L]
</IfModule>
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments