#!/usr/local/bin/perl # # Use this CGI script in the following way: # # # This will record in a log each time someone clicks on the # above link. Then, the web browser will be redirected to # the specified URL (http://new.url.here/). # # The log will be stored in: # $logFile="/tmp/redirect.log"; # # Make sure that it can be read & written by the httpd process # (chmod a+w /tmp/redirect.log) # retrieve the URL to be redirected to: $toURL=$ENV{'QUERY_STRING'}; # current date & time $date=localtime; # append the date, remote IP adress and destination to the log open F, ">>$logFile"; print F "$date - $ENV{'REMOTE_ADDR'} => $toURL\n"; close F; # redirect print "Location: $toURL\n\n"; exit(0);