Code

Art | Bicycling | Food | Hacks | Making Stuff | Music | Wirehead
Home | Mail
WireWorld > Hacks > Marginal > Browser Sensitive Redirect

Browser Sensitive Redirect

This will detect browsers and send the user to four different sub pages. Netscape users will receive the Netscape page. Internet Explorer will receive the Internet Explorer page. Lynx users will receive the Text Only page. And, finally, if you are using something else, the CGI will send you to the Average page.

It's much nicer than the usual approach of giving the user an introductory screen asking for what browser they are using. It is transparent to the user, and will not load down your server.

To adapt to your page:

  1. Place this file, renamed index.cgi, into the directory you with to make independent.
  2. Create four directories, avg/ ie/ ns/ and text/
  3. Remove your index.html and create four tailored index.html files for each of the four directories.
  4. Specify all pathnames without an index.html. For example, if your netscape specific file is at "http://www.yyy.com/ns/index.html", you should specify the URL as "http://www.yyy.com/"

Download source / View source

Copyright 2007, Ken Wronkiewicz
Version 4.0
Last Updated: 2002-02-15 12:00AM
Posted: 2002-02-15 12:00AM