# Browser Detection/Redirection Program
# Version 1.2
# Browsertest README File
# By Mike Calabrese
# http://www.mikecalabrese.com/index.shtml
# 11-23-2004
# This application is available for free on an AS-IS basis. I am not
# responsible for consequential damages, loss of income or whatever
# else that may happen as a result of the use of this program.
This is a simple program that detects the type of web browser that a user
has and redirects them to the appropriate web page. It consists of a Perl
script called browsertest.pl, a number of destination web pages for
different web browsers and a log file for logging the types of browsers that
hit the Perl script.
The way that this program works is that the Perl script writes the user
agent string of the incoming web browser, then evaluates it. If the user
agent string contains "MSIE", the user is redirected to the Internet
Explorer page, if the string contains "Opera", the user is redirected
to the Opera page, if the string contains "Firefox", the user is redirected
to the Firefox page, if the string contains "Safari", the user is
redirected to the Safari page, if the user agent string has the word
"Mozilla", a set of brackets and a set of parentheses, the user is
redirected to the Netscape page.
If you are downloading the files, be sure to download the browsertest.pl
compressed file to your cgi-bin directory and the HTML files to where your
HTML files reside. If obtaining the files by email, be sure to follow the
configuration steps below.
The following configuration changes need to be made to successfully run
this application:
1) Create a directory on your web server where your HTML documents reside
called browsertesthtml. Chmod it to 755. In some cases, you may have to chgrp
this directory to the proper group name for your site. Place the HTML files
into this directory. Chmod these files to 755. You may have to chgrp them to
the proper group name for your site. No configuration changes are necessary
for the HTML files.
2) Place the perl script browsertest.pl in your cgi-bin directory within it's
own directory called browsertestcgi. Be sure to chmod browsertest.pl to 755
and the browsertestcgi directory to 755. On some servers you will have to
chgrp these files to the proper ownership name for your site. On some sites
you may have to change the .pl extension to .cgi.
The only things in the Perl script that need to be changed are to make sure
that the path to Perl is correct. Typing "which perl" at the
command line will answer that. Also, make sure that the url path to
the various HTML redirect forms are correct and the UNIX path to the file
useragents is correct.
This program could be further modified so that it looks for Mac, Windows,
AOL, EarthLink or what ever other particulars you like and redirects them
to the appropriate page.