user3201356
user3201356

Reputation: 23

Website redirection based in ie browser version

I have a website running which is supported by IE8. I want replace this with a new website,but the new website is not supported by IE8. Is there some way where i can redirect the new website to show the old website itself if the browser version is less than IE9. (website is completely in html n css)

Thank You.

Upvotes: 1

Views: 86

Answers (2)

Rohan
Rohan

Reputation: 3334

First set up your ie classes correctly

<!doctype html>
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie7"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->
<head>
And add some simple script:

(function ($) {
    "use strict";

    // Detecting IE
    var oldIE;
    if ($('html').is('.ie6, .ie7, .ie8')) {
        oldIE = true;
    }

    if (oldIE) {
        window.location.href="new url";
    } else {
        // ..And here's the full-fat code for everyone else
    }

}(jQuery));

Source - http://www.paulirish.com/

Upvotes: 1

sanjeev
sanjeev

Reputation: 4621

Just write these line at the top

 <!--[if IE 8 ]>   <META http-equiv="refresh" content="0;URL=http://oldurl.com"> <![endif]-->

replace oldurl.com with your ie8 supported url

Upvotes: 1

Related Questions