Prevent viewing page using Internet Explorer

browsercross-browserinternet explorer

I have developed a site that looks great in modern browsers like Chrome, Safari, Firefox and Opera, however, it looks terrible in older versions of Internet Explorer.

Is there some code that I can use that will prevent the page from loading if it detects an older version of IE?
Perhaps the code could load a different page?

Any ideas on how to best accomplish this? Thanks.

Best Answer

Yeah for sure, you can use a client side re-direct, or a server-side redirect. OR You can just display different content based off the browser.

Javascript/jQuery:

if ($.browser.msie && parseInt($.browser.version, 10) < 9) {
    // Do IE specific Tasks
    // window.location = "http://somewhat.com"
}else{
   //Do other tasks
}

PHP:

<?php
$browser = get_browser(null, true);
print_r($browser);
?>