Reputation: 179
Im having problems with bot* and *bot. I have limited knowledge of .htaccess but have been blocking bots with .htaccess rules below.
My question is in 2 parts:
*
bot and bot*
Many thanks in advance
#Enable RewriteEngine
RewriteEngine On
# Stop the Nasties!!
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^autoemailspider [OR]
RewriteCond %{HTTP_USER_AGENT} baiduspider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} baidu [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Baiduspider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Baiduspider* [OR]
RewriteRule ^.* - [F,L]
Upvotes: 0
Views: 805
Reputation: 785068
You can combine all those conditions into one as:
RewriteCond %{HTTP_USER_AGENT} (autoemailspider|baidu) [NC]
RewriteRule ^ - [F]
NC
is for ignore case.
Upvotes: 0
Reputation: 1
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:[email protected] [OR]
RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.* - [F,L]
Yes, it is right way...
And, if you want to block any IP, then as an example:
Order Deny,Allow
Deny from 127.0.0.1
Upvotes: 0