Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In one case i wish to block all Internet Explorer versions from my site using htaccess. I have read several guides but still can not get it to work. what is the most understanding way of doing it. If somebody can show an example and explain it for better usage. In the other case i wish to ONLY allow Chrome latest version and Firefox latest version to see the website.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Something along these lines:

RewriteCond %{HTTP_USER_AGENT} ^.*Chrome/10.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*Firefox/4.*$
RewriteRule .* - [L]
RewriteRule .* http://mydomain.com/browsererror.html [R,L]

This will check for a User Agent containing either Chrome/10 or Firefox/4 - you can get more specific as needed. If it matches, it'll skip the final rule. If they don't have the needed browser, the final rule will hit, sending the user on a redirect to an error page of your choice.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.