Bryan Olson fakeaddress at nowhere.org
Thu Feb 28 15:44:55 CET 2008

rodmc wrote:
> Probably a silly question but I am writing a CGI script which need to
> check the referring URL, can anyone provide any pointers? I have
> looked at URLLib2 and a couple of other libraries, but am slightly
> confused.

When you say, "check the referring URL," what are checking about
it?  Do you just want to know from where your users came? C.l.p is
one of Usenet's more helpful groups, but you have to clear and
exact, or we're likely to correctly answer the wrong question.

There are many plausible checks one might apply to the referring
URL. Some are trivial, some subtle.

One reason that web servers check referring URL's is to try to
ensure that clients go through the intended path. Perhaps the
site simply wants to make sure users see teh terms-and-conditions,
but more commonly it wants to stop other sites from "deep
linking", or thwart so-called "bandwidth theft". In these cases,
checking the referrer is a weak solution; the better method is
based on cookies.


More information about the Python-list mailing list