Prevent compatibility view mode in IE for Intranet sites with server settings

cross-browserinternet explorer

I am building a site that is hosted as an Intranet. I need it to not be in Compatibility View for IE.

Apparently, IE by default is set to always display Intranet sites in Compatibility View mode. I have tried using meta tags, standard xhtml dom but nothing seems to be able to force off Compatibility mode. The only way is to have the user go to Tools/Compatibility View Settings/ and uncheck "Display intranet sites in Compatibility View".

Is there a way to force off Compatibility View in Intranet sites using the server settings?

I have tried:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>TEST</title>
</head>
<body> 
    test
</body>
</html>

and,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TEST</title>
</head>
<body> 
    test
</body>
</html>

and,

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />

Best Answer

Your first example should work. Note however that IE will still send the IE7 User-Agent header to the server, so you should not do server side detection of the IE version. Also when testing, you need to clear the cache and restart the browser when you change the code, as IE will try to remember the last used compatibility view setting for your site instead of reading the X-UA-Compatible value.

Related Topic