Force Internet Explorer Compat-Mode Off

2014-03-12 | #solution, #webdev

Internet Explorer is bad enough as it is, but apart from being the worst browser on the market it is also quite common in big companies, that also tend to use old web applications, which regularly force IE into it's compat-mode.

The compatability mode is more or less an emulator for shitty deprecated behaviour, to make all those "IE optimized" old apps usable, that those companies just can't live without. Sadly, using the compat-mode results in IE reporting a wrong render engine version, which can get annoying very quickly.

To circumvent this nonsense add two directives to your site, one server-side (PHP in this case)

header('X-UA-Compatible: IE=edge,chrome=1');

and one client-side (just to be extra sure)

<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>

And voila!

PS: Be aware that this meta-tag doesn't validate.