About

You’re visiting the personal website of Joost Schuttelaar.

Take a look

Contact

You can e-mail me at jelephants @ jstsch.com (anti-spam: please remove the mammal with the big snout).

Twitter feed @jstsch

Sorry, feed is gone. API has been killed by Twitter.

Recent posts

Permanently kill IE's compatibility view – server side

Thursday September 29 2011

A small moment of triumph today. After a company-wide rollout of IE9, some internal apps seemed to break. What actually was happening that people were pushing the Compatibility View button for some reason.

Fretting over having to update dozens of sites and apps with a set of meta tags to prevent Compatibility View, a better solution appeared. Why not serve this meta tag as a HTTP header? It works! Simply add the following lines to your Apache configuration (for instance apache2.conf or httpd.conf) and you’ll be permanently freed from users triggering IE7-mode on you…

<IfModule mod_setenvif.c>
  <IfModule mod_headers.c>
    BrowserMatch MSIE ie
    Header add X-UA-Compatible "IE=Edge,chrome=1" env=ie
  </IfModule>
</IfModule>

Make sure you have both modules installed and enabled. On Ubuntu simply fire off a2enmod headers to enable the headers module. As an added bonus, the above headers will trigger Google Chrome Frame as well, if available…

Comments


(never shown, not required)
(not required)