AnswerBun.com

Serving from different directories for Internet Explorer

Server Fault Asked by Kevin Sedgley on August 25, 2020

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:

/app/foo/bar

would be served from the directory:

html/ie/foo/bar

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

html/other/foo/bar

Is this possible to achieve using .htaccess?

One Answer

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

/app/
  - index.html (for modern browsers)
  - .htaccess (with remapping for IE 6-8)
  /ie
    - 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

Answered by Kevin Sedgley on August 25, 2020

Add your own answers!

Related Questions

Is it possible to mount CIFS onto Solaris 10 server

1  Asked on December 25, 2021 by andym

     

disable ssl for mysql client apps

1  Asked on December 25, 2021

     

.NET Issue on ADFS SSO behind a Reverse Proxy

1  Asked on December 25, 2021 by yoshimori

         

Apache simple redirect not working

1  Asked on December 25, 2021 by cma4

     

ESXi 6.7: Suddenly unable to login

1  Asked on December 25, 2021 by farosch

   

Jenkins Integration with Android studio

2  Asked on December 25, 2021 by manikandan-ram

       

Virtual users in sshd from a postgres database

2  Asked on December 23, 2021 by bastien-abadie

       

Tuning high-raffic nginx and wordpress server

2  Asked on December 23, 2021 by reustmd

         

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir