如何仅针对IE 9在.htaccess中设置HTTP标头

Rah*_*hul 3 apache .htaccess

仅当浏览器是IE9时,我才能找到并在.htaccess文件中设置一些标头的方法.我的要求的伪代码是:

if (IE 9) {
    header set (value)  
} else {
    header set (value)
}
Run Code Online (Sandbox Code Playgroud)

请建议我如何在我的.htaccess文件中实现此目的.

Rah*_*hul 8

我在阅读了Apache doc :)中的一堆行后得到了解决方案.只需在htaccess中包含这些行,它对我来说很好.

BrowserMatch "MSIE 9.0"  ie9
header set X-UA-Compatible "IE=EmulateIE8" env=ie9
Run Code Online (Sandbox Code Playgroud)