How do I set X-UA-Compatible header to IE=EmulateIE7 for IE 8 browsers using Apache 2.0?
-
06-07-2019 - |
Question
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?
Solution
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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow