Rendering Websites in IE8

The latest version of Internet Explorer (version 8) is currently at Beta and due to be publicly released at the end of 2008.

You may experience one of the following issues when you use the Beta version of Microsoft Internet Explorer 8:
• Misaligned Web page layout
• Overlapping text or images
• JavaScript functionality issues and errors

There is a tag that can be added to servers or individual web pages that allow a page to be rendered in an IE7 style (imitating the ‘Emulate IE7’button within IE8). Full detail is given at http://support.microsoft.com/kb/952030. Note that in IE8 Beta 2 will initially render such tagged pages in IE8 mode, but a ‘Compatibility Mode’ button will appear in the address bar for ‘broken’ pages.

Two solutions are given:
1. Embed <meta http-equiv=“X-UA-Compatible” content=“IE=EmulateIE7” /> into the HEAD of each web page
2. Add an HTTP header X-UA-Compatible: IE=EmulateIE7 for the whole site – the MS KB article describes how to do this for IIS.

Add IE8 HTTP Header to Apache

Add following in httpd.conf file:

<FilesMatch “\.(html|htm|php)$”>
Header set X-UA-Compatible “IE=7”
</FilesMatch>

<FilesMatch “\.(html|htm|php)$”>
Header set X-UA-Compatible “IE=EmulateIE7”
</FilesMatch>

NOTE: The X-UA-Compatible tag and header override any existing DOCTYPE. Also, the mode specified by the page takes precedent over the HTTP header. For example, you could add the EmulateIE7 HTTP header to a site, and set specific pages to display in IE8 mode (by using the meta-tag with content=”IE8”).