Forum Moderators: phranque
I want to protect my web site with htacces. I want to allow only internet explorer, firefox, opera because of bot attacks.
RewriteCond %{HTTP_USER_AGENT} EmailWolf [OR]
RewriteCond %{HTTP_USER_AGENT} ExtractorPro
RewriteRule ^.*$ X.html [L] For example this code makes EmailWolf and ExtractorPro agents send to x.html, but other user agent open default url. But i want to restrict other agents, with else or not equal syntax.
How can i do this?
# Rewrite requests from all user-agents except modern Internet Explorer, Firefox, Opera
RewriteCond %{HTTP_USER_AGENT} !^Mozilla/4\.[0-9]+\ \(compatible;\ MSIE\ [0-9.]+
RewriteCond %{HTTP_USER_AGENT} !^Mozilla/5\.0 \(([^;]+;\ )*[^;]+\)\ Gecko/2[0-9]{3}\ Firefox/[0-9.]+
RewriteCond %{HTTP_USER_AGENT} !^Opera/[0-9.]+
RewriteRule .* X.html [L]
RewriteRule .* - [F]