How to block IE8 and down?

Do it with CSS and conditional comments.

<head>
    <!--[if IE lte 8]>
    <link rel="stylehseet" type="text/css" href="blockIE.css" />
    <[endif]-->
</head> 
<body>
    <div class="yourcontent">
        ...
    </div>
    <div class="notification">
        <h1>Sorry, we don't support your old browsers</h1>
    </div>
</body>

CSS:

body * { display: none }
.notification { display: block; }

You can also do it with CodeIgniter, https://www.codeigniter.com/user_guide/libraries/user_agent.html

Something like:

$this->load->library('user_agent');
if ($this->agent->browser() == 'Internet Explorer' && $this->agent->version() <= 8){
    //Redirect or show error
}

(Also answered here: Code Igniter - Best way to detect browser)


This checks for IE 8 browsers and lower. it is used in the < head >

<!--[if lte IE 8]>
    <meta http-equiv="refresh" content="0; url=http://www.google.com" />
    <script type="text/javascript">
        window.top.location = 'http://www.google.com';
    </script>
<![endif]-->