[10470] in www-talk@info.cern.ch
Finding who is pointing to your server.
daemon@ATHENA.MIT.EDU (Alejandro Rivero)
Wed Dec 11 14:13:36 1996
Date: Wed, 11 Dec 1996 19:50:07 +0100
From: Alejandro Rivero <rivero@sol.unizar.es>
To: www-talk@w3.org
Resent-From: www-talk@w3.org
This is a multi-part message in MIME format.
--------------167EB0E72781E494446B9B3D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
http://dftuz.unizar.es/wwwlab/links.html
--------------167EB0E72781E494446B9B3D
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="links.html"
<BASE HREF="http://dftuz.unizar.es/wwwlab/links.html">
<!DOCTYPE HTML PUBLIC>
<head>
<TITLE>Who is pointing to you?</title>
</head>
<body>
<h2>Finding what pages are pointing to your server</h2>
<p>
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:
<p>
We made (very reciently) a CGI miniscript to
record the refered page when someone reach our node
<p>
<pre>
#!/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
</pre>
Then, to activate it we simply note it in the <tt>httpd.config</tt>
file of our nice <b>CERN httpd</b> server:
<pre>
Exec /*html /home/http/cgi-bin/logfrom.sh
</pre>
So any request for a .html file is redirected to the script. Access
to gifs, etc is not logged.
<p>
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:
<PRE>
LINK HREF="$HTTP_REFERER" REV=X-PointsTo
</PRE>
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?
<address> rivero@sol.unizar.es </address>
</body>
--------------167EB0E72781E494446B9B3D--