从Internet Explorer的不同目录服务

我们有两个不同版本的网站 – 一个用于旧版Internet Explorer(7和8),另一个用于所有其他浏览器。

(围绕JS特征检测的争论已经做出了,但是我们发现这样做更容易!)

我们想静静地(即没有301)文件从一个不同的目录服务 – 所以请求:

/app/foo/bar 

将从目录中提供:

 html/ie/foo/bar 

对于Internet Explorer 8及更低版本,以及其他浏览器:

 html/other/foo/bar 

这有可能实现使用.htaccess

我已经做了以下(与目录结构略有改变):

 /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) 

/ app中.htaccess的内容是:

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

/ app / ie中的.htaccess的内容是:RewriteEngine off