Return CGI Library
Ever wonder how many people link off of your page, and wonder where
they went? Well now you can find out. Using this gadget allows
you to set links which "bounce" off our server (after being logged) and
take the browser to the intended destination site. (Counting "Click-Throughs"
is another common use.)
Warning:This gadget might not work for some browsers
behind proxy servers or firewalls.
The magic codes are:
<a href="/cgi-bin/redirect/userid/logfile?http://some.other.server/some/path">
The userid and logfile parameters tell the server where to log the
information. For example:
<a href="/cgi-bin/redirect/tbrown/redirect.log?http://baremetal.com/">
Would create a file in my (tbrown) home directory called redirect.log.
This file will have one line in it for each URL that you are
redirecting TO, and a redirect count... that is, the
number of times people have been redirected to that URL.
This gadget doesn't currently log which page the redirect came from. If
you feel that this would be a "good thing", let us know.
NOTE: We've recently changed the syntax such that the URL is specified after
a question mark instead of after a '/'. This should make the gadget work better with some browsers (notably some versions of MSIE 4.0beta2). It also allows
you to put the log files into subdirectories. (Our thanks to
John Charlesworth for suggesting this solution.)
NOTE2: Some people have had trouble with broken robots messing up
the logfile parameter... which has the effect of creating a bunch of
logfiles in your home directory. Change the /cgi-bin/redirect to
/cgi-bin/redirect-nc to avoid this (nc stands for "no create").
The redirection process may NOT be transparent for all browser types.
In the worst case, a screen will appear stating that the document has
moved to a new (specified) location, and provide a link to that location.
The location of the browser (e.g. behind a proxy server or firewall) might also
affect the functioning of this gadget.
|