开发者

How to set HTTP headers in .htaccess only for IE 9

开发者 https://www.devze.com 2023-04-02 10:40 出处:网络
I am not able to find and way to set some header in .htaccess file only if the browser is IE9. Pseudo code for my requirement is:

I am not able to find and way to set some header in .htaccess file only if the browser is IE9. Pseudo code for my requirement is:

if (IE 9) {
    header set (value)  
} else {
    header set (value)
}

Please suggest how I can achieve this in 开发者_如何学Gomy .htaccess file.


I got the solution after reading bunch of lines in Apache doc :) .Just include these lines in htaccess, Its working fine for me.

BrowserMatch "MSIE 9.0"  ie9
header set X-UA-Compatible "IE=EmulateIE8" env=ie9


According to this article <meta http-equiv="X-UA-Compatible" content="IE=8" /> should give you the desired result regardless of which version of IE you're using.

0

精彩评论

暂无评论...
验证码 换一张
取 消