How do I set X-UA-Compatible header to IE=EmulateIE7 for IE 8 browsers using Apache 2.0?

微笑、不失礼 提交于 2019-12-01 09:24:28

问题


I am able to set this header

X-UA-Compatible "IE=EmulateIE7"

using the following directive in my Apache 2.0 httpd.conf file:

<Location /mypath>
   Header set X-UA-Compatible "IE=EmulateIE7"
</Location>

How can I configure Apache to only set this header for IE 8 browsers?


回答1:


This is the best I could come up with so far. It seems to work. If anyone has a better way, please let me know.

BrowserMatch "^.*MSIE 8.*$" emulate_ie7

<Location /mypath>
   Header set X-UA-Compatible "IE=EmulateIE7" env=emulate_ie7
</Location>


来源:https://stackoverflow.com/questions/831119/how-do-i-set-x-ua-compatible-header-to-ie-emulateie7-for-ie-8-browsers-using-apa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!