简体   繁体   中英

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

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 my .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

根据这篇文章 <meta http-equiv="X-UA-Compatible" content="IE=8" />应该会给你想要的结果,无论你使用的是哪个版本的IE。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM