Category Archives: Internet Explorer

Block/Redirect IE6 users

This script may not be for everyone but it is pretty cool.

<?php

$ua = $_SERVER['HTTP_USER_AGENT'];

if (strpos($ua,'MSIE') != false && strpos($ua,'Opera') === false)
{
if (
strpos($ua,'Windows NT 5.2') != false)
{
if(
strpos($ua,'.NET CLR') === false) return;
}
if (
substr($ua,strpos($ua,'MSIE')+5,1) < 7)
{
header('Location: http://redirect.com');
}
}

?> 

That little snippet of PHP coding will redirect all IE6 users to a different page. This is perfect for designers who want the follow the trend of Open Addict and block all IE users from viewing their website. You can find out more about this code here. Also do not forget the opening and closing tags.

Advertisements