I'm currently working on a new web project and have some issues optimizing it for Internet Explorer (huh, who would've thought that?) ... I want to support IE8+ but redirect IE 7 and earlier to an alternative page, recommending the download of another browser. For IE8 I want to display a message, recommending another browser, but not redirect it. In IE 9+ everything's fine. First problem I came accross was, that IE10 always rendered the page in Compatibility Mode, using IE7 Standards and making the page look shitty. So I introduced the X-UA-Compatible meta tag like this:
<meta http-equiv="X-UA-Compatible" content="IE=10,IE=9,IE=8" />
Then I tried to realize the redirect for IE7 and below using
<!--[if lte IE 7]>
<script type="text/javascript">
document.location.href = "outdated.html";
</script>
<![endif]-->
Testing the page in IE11 in the different modes using F12 just wouldn’t do the redirect and displays the page crappy in IE7 and below, so I assume the X-UA-Compatible meta tag breaks the conditional comments. Nonetheless, without the tag all IE versions lower than IE10 are redirected even if the conditional comments says "lte IE 7" ...
I don't seem to be able to solve this myself, so any help will be appreciated! :)
Cheers, Rob