Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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 .* [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


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.