Thursday, February 4, 2010

Force IE7 Compatibility Mode in IE8 with IIS settings

Force IE7 Compatibility Mode in IE8 with IIS settings
There a ton of examples on the web of how you can force IE8 into IE7 compatibility mode using a meta tag in the header.
This tag needs to be first in the (before any css):


That really stinks if you need to add that to a lot of pages or sites. It’s much easier just to add the header as real HTTP Header via IIS. This can be done via IIS 6 or 7.

IIS 6
Go to the website, bring up the properties for it, and click on the HTTP Headers tab.


HTTP Headers tab of an IIS 6 Website

Then, add a new header as below:
Add custom HTTP Header

IIS 7
IIS 7 is much the same. Just go to the site and click on “HTTP Response Headers”.

IIS 7 Website Properties – IIS Section
Then, just add the header:
Add custom HTTP Header
Incidentally, this just sets a value in the web.config, as below:

< httpProtocol >
< CustomHeaders >
< add name="X-UA-Compatible" value="IE7" / >
< /CustomHeaders >
< /httpProtcol >
< /System.webServer >

No comments:

Post a Comment