Image
Top
Menu
April 1, 2012

Redirecting IE6 users using PHP

I have finally bitten the bullet and decided not to support IE6 for many items of work

ie6

I have finally bitten the bullet and decided not to support IE6 for many items of work. This short simple snippet of code identifies users using Internet Explorer 6 and redirects them to a IE6 holding page.

<?php
$get_user_agent = $_SERVER['HTTP_USER_AGENT'];

       if(strstr($get_user_agent, 'MSIE 6.0')) {
             header( 'Location: /ie6.html' );
             exit;
        }
        else {
        }
?>

There are many examples of how to do this on the web but I have found them to be over complicated and difficult to implement.

This example is perfect to use for WordPress. Simply drop this code snippet at the very top of your header.php and save yourself hours of dev time trying to hack an IE6 specific stylesheet.

Posted By

Categories

Uncategorized