Bryan Soltis

Senior Software Engineer

Force IIS to render sites as IE7

Posted on November 5, 2009

Coding for IE 8 is a daunting task.  The new browser has increased its security and lowered its tolerance of lax, non standard coding.  This is actually a good thing.  But if your sites are not written quite right, things definitely don’t look too good to anyone who happens to be upgraded to the newest version.  Microsoft knows that updating sites is a time consuming process and that some companies may never do it completely.  To get around this issue, Microsoft supplies a number of options for making sure your site will display properly for all users.

The answer lies in the IE=EmulateIE7 custom header.  This little piece of code is injected in the header of your site and tells IE8 to act like it’s older sibling, IE7.  IE8 will apply IE7 standards, as well as render the document type to IE7.  This process is automatic and the user will just view the site normally.  

There are several methods to add the custom header.  You can use inline header code, write it out manually at the top of your pages, or configure your firewall to inject the new information on every request.  The easiest (and the recommended process by Microsoft) is to use IIS and insert the header at a site level.

Here are the steps to do this:

1. Open IIS and navigate to your site.


2. Open the properties.


3. Click the “HTTP Headers” tab


4. Click “Add” and enter the following information:
a. Custom Header Name: X-UA-Compatible
b. Custom Header Value: IE=EmulateIE7



NOTE:  You can also add this header at the “server” level in IIS by following the same process, but starting from the properties of the server and not the site.  Be sure that you do NOT have the header specified on the site level prior to doing this.  Otherwise, your ASPNET sites will fail.

 

Comments
Blog post currently doesn't have any comments.

Want to join the conversation?  Leave a comment using the form below!



 Security code