Finding what pages are pointing to your server

Do you wonder how people keeps coming into your webpages, even if you made no effort to get it? Is your server not giving you information about it? Well, it is easy, and probably you can find some solutions in the archive. Ours is the following:

We made (very reciently) a CGI miniscript to record the refered page when someone reach our node

#!/bin/sh
######################################################################
# file: GET para registrar logs de lugars que nos CITAN 
# Date: noviembre 1996.  Author: Alejandro Rivero 
######################################################################
#
# We use this script to log access to html documents, so 
# the adequate Type is:
echo 'Content-Type: text/html'
echo ''
#
# Our document tree starts at ./htdocs, so we look there and
# we send the document to the client
cat /home/http/htdocs/$SCRIPT_NAME
# Now we check for referers from external pages (our server being "dftuz")
# and store them in a local file for further analysis 
if (!(`echo $HTTP_REFERER | grep -q dftuz`)) then 
echo  $HTTP_REFERER $REMOTE_HOST $SCRIPT_NAME >> /home/http/logs/cites 
fi
# and that was all ! 
exit 0
Then, to activate it we simply note it in the httpd.config file of our nice CERN httpd server:
 
Exec    /*html                  /home/http/cgi-bin/logfrom.sh
So any request for a .html file is redirected to the script. Access to gifs, etc is not logged.

Apart curiosity, we have no idea about what to do with the resulting file. But we think about storing the acumulated link information for each file and dinamically add it to the HEAD part, with a tag as:

LINK HREF="$HTTP_REFERER" REV=X-PointsTo
Regretly, I'm not aware of any decent REL/REV value supported by current browsers. A pity, as they could provide a nice menu to go "Up". Any suggestion?
rivero@sol.unizar.es