.htaccess浏览器重定向IE6

时间:2012-07-31 16:51:46

标签: .htaccess internet-explorer-6

我最近将服务器从1and1移动到了GoDaddy,用于客户端。我注意到他们对IE6用户的重定向不再适用于他们。加载主网页而不是重定向页面。请注意,目录仍然与以前的现有服务器上的目录相同。

<IfModule mod_rewrite.c>
  # redirect IE 5 or 6 requests to version-specific subdomains 
  RewriteCond %{HTTP_USER_AGENT} MSIE\ ([56])\.
  RewriteRule ^([a-z]+)\.html$ /ie6users/index.php [R=302,L]
</IfModule>

我不确定我在这里做错了什么,但重定向不再有效。

提前感谢任何提示/建议。

1 个答案:

答案 0 :(得分:1)

这些规则看起来很好,你确定你打开了重写引擎吗?

<IfModule mod_rewrite.c>

  RewriteEngine On

  # redirect IE 5 or 6 requests to version-specific subdomains 
  RewriteCond %{HTTP_USER_AGENT} MSIE\ ([56])\.
  RewriteRule ^([a-z]+)\.html$ /ie6users/index.php [R=302,L]
</IfModule>

当我将这些规则放在空白的htaccess文件中时,IE6浏览器会从http://localhost/something.html等网址重定向到http://localhost/ie6users/index.php

相关问题