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

We have two different versions of our website - one for older versions of Internet Explorer (7 and 8), and one for all other browsers.

(arguments around JS feature detection have been made, but we have found it easier to progress this way!)

We would like to silently (ie without a 301) files to be served from a different directory - so a request to:


would be served from the directory:


for Internet Explorer 8 and below, and for other browsers from:


Is this possible to achieve using .htaccess?

share|improve this question

I've done it with the following (with a slight change to the directory structure):

  - index.html (for modern browsers)
  - .htaccess (with remapping for IE 6-8)
    - index.html and other files
    - .htaccess (to turn off further remapping efforts)

The contents of .htaccess in /app is:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} "MSIE [6-8]" [NC]
RewriteRule ^(.*)$ /app/ie/$1 [PT]

The contents of .htaccess in /app/ie is: RewriteEngine off

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.