#!/usr/bin/perl # # AdMinder Redirect Script V3.1 Copyright 2002 ############################################################################ ##### OVERVIEW ############################################################# ############################################################################ # This simple script allows you to use your own domain name in all of # your tracking URLs, and you only need to set this up one time. This # script will simply redirect all traffic to the appropriate AdMinder # URL based on the username and adcode provided, as explained below. # # So now, instead of using tracking URLs like this in your ads: # # http://www.adminder.com/c.cgi?username&adcode # # You can use your own domain in your tracking URLs like this: # # http://www.yoursite.com/go.cgi?adcode # # No one will ever know you are using the AdMinder tracking system! ############################################################################ ##### INSTALLATION ######################################################### ############################################################################ # The simple instructions below should work fine for you. All servers # are different though, so if this doesn't work for you please consult # your webmaster or system administrator - they will know what to do. # # 1. Edit the 2 variables in the next section below. # # 2. Rename this file to any valid CGI script filename, based on your # server's configuration. Generally the file must end with .cgi or # .pl so a good filename would be "go.cgi", "redirect.pl", etc. # # 3. Upload this file to any directory that can run CGI scripts. Some # servers allow CGI scripts in any directory, while others require # all CGI scripts to be in the "cgi-bin","cgi" or other directory. # # 4. CHMOD this file to 755 - otherwise known as setting permissions. # This step simply allows your new script to be executed properly. # # 5. Done! Depending on the filename and where you uploaded it, your # tracking links will now look like the following: # # http://www.yoursite.com/redirect.cgi?adcode # http://www.yoursite.com/cgi-bin/go.pl?adcode # etc. ############################################################################ ##### EDIT THESE 2 VARIABLES ############################################### ############################################################################ # Replace xxx below with your AdMinder Username # Example: $username = "myusername"; $username = "xxx"; # Replace xxx below with the URL of your homepage # Example: $homepage = "http://www.mysite.com"; $homepage = "xxx"; ############################################################################ ##### DO NOT EDIT BELOW THIS LINE ########################################## ############################################################################ $adcode = $ENV{'QUERY_STRING'}; if ($username =~ /^[a-zA-Z0-9]{4,12}$/ && $adcode =~ /^[a-zA-Z0-9]{1,10}$/) { print "Location: http://www.adminder.com/c.cgi?$username&$adcode\n\n"; } else { print "Location: $homepage\n\n"; } exit;