How to Enable IE 8 Compatibility View for your whole Web site or for specific Web site directories

 

With the release of Internet Explorer 8, many customer sites suddenly had rendering errors and problems displaying the site correctly.

https://www.microsoft.com/windows/Internet-explorer/default.aspx

 

In order to avoid expensive and time consuming corrections Internet Explorer 8 has a new functionality called Compatibility View which enables the browser to emulate Internet Explorer 7.

 

Internet Explorer 8 Compatibility View

https://www.microsoft.com/windows/internet-explorer/features/enhanced-navigation.aspx

 

The question many customers asked is ”How can I force the client browser to use the Compatibility View when they visit our site? So that the customer doesn’t have to activate it on the client side.”

Web Developers and Site Administrators can configure IIS and their sites to tell Internet Explorer 8 to automatically Emulate Internet Explorer 7 when they visit their site or just specific WebPages.

This is done by adding a custom HTTP Header to the IIS and the website web.config or to add a meta tag to specific pages. The HTTP Header is interpreted by the Internet Explorer 8 which will activate the compatibility view. All other browsers will simply ignore this custom HTTP Header.

  
 X-UA-Compatible: IE=EmulateIE7
  

Add the custom HTTP response header in IIS

To add a custom HTTP response header at the Web site level, at the folder level, or at the virtual directory level in IIS, follow the steps for the version of IIS that you are using.

IIS 7 on a Windows Server 2008-based Web server

    1. Start IIS Manager. To do this, click Start, click Run, type inetmgr, and then click OK.

    2. Under Connections, double-click the server that you want, and then double-click Sites.

    3. Click the Web site, the folder, or the virtual directory where you want to add the custom HTTP response header.

    4. Under <Web site name> Home, double-click HTTP Response Headers in the IIS section.

    5. Note The <Web site name> placeholder refers to the name of the Web site.

    6. Under Actions, click Add.

    7. In the Name box, type X-UA-Compatible.

    8. In the Value box, type IE=EmulateIE7.

    9. Click OK.

  1.  

  2. IIS 6 and earlier versions

    1. Click Start, click Run, type inetmgr.exe in the Open box, and then click OK.

    2. Expand the server that you want, and then expand Web Sites.

    3. Right-click the Web site, the folder, or the virtual directory that you want, and then click Properties.

    4. On the HTTP Headers tab, click Add under Custom HTTP headers.

    5. In the Custom header name box, type X-UA-Compatible.

    6. In the Custom header valuebox, type IE=EmulateIE7.

    7. Click OK two times.

  3.  

  4. Add the custom HTTP response header in the Web.config file

  5. To add this header to the Web.config file, create or revise the Web.config file as follows.

 <?xml version="1.0" encoding="utf-8"?>
  <configuration>
     <system.webServer>
           <httpProtocol> 
               <customHeaders> 
                    <clear /> 
                    <add name="X-UA-Compatible" value="IE=EmulateIE7" /> 
               </customHeaders> 
           </httpProtocol> 
     </system.webServer> 
  </configuration>

Note Add this new or revised Web.config file to each Web directory in which you want to use compatibility mode.

 

More information can be found in KB 968499, about configuring the Compatibility View.

 

KB 968499 - Advanced solutions: Some Web sites may not be displayed correctly or work correctly in Windows Internet Explorer 8

https://support.microsoft.com/kb/968499

 

Pedro M. Pinheiro

Comments