: Am I doing .htaccess right to block google, bing and alexa bots? I do not need bots at all. I bought my traffic and I do not want my sites to show up on search engine or anything. So
I do not need bots at all. I bought my traffic and I do not want my sites to show up on search engine or anything.
So I added this:
<IfModule mod_setenvif.c>
# remove most popular bot
SetEnvIfNoCase User-Agent ".*alexa.*" bad_bot
SetEnvIfNoCase User-Agent ".*google.*" bad_bot
SetEnvIfNoCase User-Agent ".*bing.*" bad_bot
Am I doing it right?
Basically any user agent containing alexa google or bing will not pass
More posts by @Margaret670
1 Comments
Sorted by latest first Latest Oldest Best
I may be somewhat overboard with my regex part, but these lines in your apache configuration will block them. Basically it scans the entire user agent identification string to see if it contains "googlebot", "bingbot" or "alexa" and if it does then direct users to the default error 403 page
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^(.*)googlebot(.*)$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(.*)bingbot(.*)$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(.*)alexa(.*)$ [NC]
RewriteRule .* - [F,L]
And if you want to set a custom error 403 page, use this line:
ErrorDocument 403 /path/to/errordocument.htm
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.