There are quite a few browsers out there, but they are, for the most part, pretty much the same. The only major differences are in their rendering engines, that is, the code that allows them to display web pages. The most popular one is Gecko, which is used by Firefox, Mozilla, and Netscape. Another is Presto, used by Opera. Finally, there is Trident, the layout engine used by Internet Explorer. Of course there are others, but this isn’t a post about layout engines. You’ve got Wikipedia for that.
Anyways, the rendering (or layout) engine of a browser determines how HTML and CSS are displayed. Most browsers display things similarly, but not Internet Explorer. IE has always been the black sheep of the browser family, preferring proprietary functions (such as ActiveX) to standards. Of course, no browser is completely standards-compliant, but IE is as far off as it can get. The most recent version, IE7, has solved quite a few problems, especially with CSS, but it can still be a hassle to code a website that will work perfectly in all browsers. The problem is that IE is still the most used browser. If your site doesn’t work in IE, you’re going to have a lot of people who will steer clear of it.
The answer? Well, you could just eliminate anything in your site that’s causing problems with IE. Or, you could let web surfers know about Firefox. Chances are that the only reason most people are still using IE is that they don’t know about any alternatives. Read on to see an easy way to let IE users know they should switch to Firefox while allowing non-IE users to continue on with no trouble.
First off, get an account at Spread Firefox. Well, you don’t really have to, but the site gives you a bunch of tools for spreading the word about the browser. Plus you can get cool buttons, complete with an affiliate link that will gain you points every time a person clicks on it. These points can get you prizes and visibility which can drive traffic to your site.
Next, create a text file with the following PHP code inside it, positioned before the opening html tag:
<?php
if(strpos($_SERVER['HTTP_USER_AGENT'],’MSIE’)===false)
{
header(‘Location: http://www.yoursite.com/’);
exit();
}
?>
Now, change the link to whatever you want. Put the rest of your website in with a warning about IE, a link to download Firefox (the affiliate link you got from Spread Firefox), and a link to continue on to your site. Finally, save this file as a .php file, such as index.php. This is necessary so that the code is recognized as a PHP script, and not simply HTML.
In order to get this fully working, you should make the existing front page of your website index2.htm, or index2.php (depending on what extension it already is) and modifying any links to the home page in the site to point to index2, so IE users aren’t constantly reminded to get Firefox.
Now, whenever an IE user visits your site, this page will show up. But if person using Firefox, Netscape, Safari, Opera, or any other browser that doesn’t use IE’s layout engine visits the site, they’ll be redirect to the URL you specified in the PHP code. This is just a basic tutorial on implementing this, and there are ways to do it in other programming languages as well. Experiment with it and see what you can come up with.
