Skip to content

Instantly share code, notes, and snippets.

@robbestad
Last active December 19, 2015 04:19
Show Gist options
  • Select an option

  • Save robbestad/5896750 to your computer and use it in GitHub Desktop.

Select an option

Save robbestad/5896750 to your computer and use it in GitHub Desktop.
Browser redirect with PHP for IE6
<?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://www.mydomain.tld');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment