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.
This is great! I am not a fan of IE7…
I use Vista, XP and the Mac OS (yes, I have the OSX installed on my PC) and obviously test everything I do with Vista+IE7, Vista+Firefox, Vista+Safari, XP+IE6, XP+Firefox, XP+Opera, OSX+Safari, OSX+Firefox and it’s only IE7 that screws everything up…
OSX on PC?
IE7 works fine for me, it is just IE6.
Yeah. As OSX is essentially a modified Linux, it’s a case of modifying it back again. Now that Mac uses Intel processors it’s also really easy to do.
I first of all tested whether it’d work by setting it up on a Virtual Machine using this guide:
http://asendure.wordpress.com/2006/10/01/osx86-how-to-install-mac-os-x-on-vmware-server-amd-64/
(except I use the Intel drivers not the AMD drivers)
…then once I knew I had hardware that supported it virtually, I just had to make myself a Journal formatted FAT32 partition and use Acronis Disk Director’s OS selector to select between the OS’s when I boot up. Works great.
You can get modified drivers (usually modified Linux drivers) in the forums of this site:
http://www.insanelymac.com/
*
I never really had any design issues with IE6, but IE7 seems to display things differently… I guess that’s just another bad thing about IE! Everyone has different issues – but we ALL have issues! :)
Wow, that is really cool. I might try it.
I think everyone hates IE6, even Microsoft.
Hey thats a really great alternative
Might redirect it to a page article on ie6 filled with google adds and ppc “great idea” Thanks
Thank you for sharing!
That’s nonsense. Just don’t care if your site works with IE and maybe tell them it’s their browser’s fault.
Are you saying to just leave your site broken?
Sorry to respond OT again, but here’s a guide I used for a native install of OS X:
http://dilnalomo.googlepages.com/
Thanks
I need to just point out that you code has some mistakes. There is an extra } on line 6. Also when you copy and paste this code you need to be careful your using the right ‘ because the ones copied from the page are wrong.
$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‘);
}
}
Thank you very much for pointing that out.
Wordpress was giving me some errors when I tried to input the code.
Thanks
Sorry guys.
Thanks
What does this section do?
if (strpos($ua,’Windows NT 5.2′) != false)
{ if(strpos($ua,’.NET CLR’) === false) return; }
Don’t you just need to check if the $ua string returns ‘MSIE 6.0’ ?
-http://lab.amanwithapencil.com/user_agent/
Thank you for this code! After 10 hours of trying every Internet Explorer 6 png hack that I could find, iepngfix.htc, and receiving less than satisfactory results in my WordPress site – this was the absolute best solution.
The corrected redirect is PERFECT.
..And remember to redirect to http://www.crashie.com
Pingback: Tips on How to Stop or Slow Down a DDoS Attack | Gettin' Geek
Very fast and perfect redirect script. Thanks a LOT.
I was wondering… How do i get this to work… do I paste it into the body? or header nothing seems to work
I agree with test.
I paste this in at the very top of the code:
<?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)
Messgae I get is:
I get a parse error Unexpected T_STRING in mywebsite.com on line 6
Pingback: Developer Blog » Internet Explorer 6 Redirection
Pingback: Blokere eller redirecte til anden side | iWANT.dk - Rå viden forklaret så det kan forstås
Useful info. Lucky me I discovered your website by accident, and I’m stunned why this coincidence didn’t happened in advance! I bookmarked it.
Got a question. This isn’t cloaking or anything right? I don’t want any SEO problems with this. Do let me know please (if not too late to ask :) )
I Just added this post to my blog and I will surely be coming back again. Excellent
Whats up are using WordPress for your blog
platform? I’m new to the blog world but I’m trying to get started and set up my own.
Do you require any coding knowledge to make your own blog?
Any help would be really appreciated!
Appreciation to my father who statred to me regarding this webpage, this webpage is really
amazing.
etta jamees at last album
young and the restless
Hello there, just became alert to your blog through Google,
and found that it’s truly informative. I’m going to watch out for brussels.
I will be grateful if you continue this in future.
Numerous people will be benefited from your writing.
Cheers!
Heya i’m for the primary time here. I found this board
and I in finding It truly useful & it helped me out much.
I’m hoping to give something again and aid others such as you helped me.
You will discover a lot of types of playing, but none payout like profitable the lottery.
In the Internet one could find some Offshore Sportsbook sites with similar
information, but they are probably charge you money for that information. ” Who would have ever guessed that this was to become the foundation of Google.
Do you mind if I quote a couple of your articles as long as I provide credit and sources back
to your blog? My blog is in the exact same niche as yours and
my visitors would genuinely benefit from a lot of the information you present here.
Please let me know if this alright with you.
Many thanks!
Attractive section of content. I just stumbled upon your web site and in accession capital to assert that I acquire in fact enjoyed account your
blog posts. Anyway I will be subscribing to your feeds and even I achievement you access consistently
rapidly.
Wow, amazing weblog structure! How long have you been running a blog for?
you made running a blog look easy. The overall glance of your web site is wonderful, as well as the content!