Changing Link Referrer Information
When you have a web page with links, and you click on a link, the destination domain server, and the web page where your browser goes to, know where you came from.
The web page you came from is the "referrer." It contains the link you clicked on; thus, it referred you to the page you clicked to. Referrer information is logged. And any script within the web page also has access to the information.
Some browsers are configured to block referrer information. And some personal firewall software has the same effect. (Which, as an aside, is why software relying on referrer information to make crucial decisions is less than reliable.) Yet, most browsers do provide the information.
Let's suppose you have a secret web page. And it has links.
When a link is clicked, your web page is no longer secret. Because it is the referrer, the destination server and web page know where your no-longer-secret page is located.
Ouch.
The solution isn't to remove the links from your secret web page, but to link to a relay script. Then, the referrer is the URL of the relay script, not your secret page.
Below is a PHP script where links can be relayed through. (See "Removing Referrer Information From Links (Perl CGI version)" for a Perl CGI version of this relay script.)
Save the above with a file name ending with .php then upload it to your server just as if it was a web page.
Let's suppose you saved the above as fakerefer.php and that it was uploaded so its URL is http://example.com/fakerefer.php
Now, change the links on your secret web page so they look something like this:
When the link is clicked, the browser is taken to http://example.com/fakerefer.php and the ?http://affinityseries.com/ in the URL tells fakerefer.php where to redirect the browser to.
The browser is redirected to http://affinityseries.com/. The referrer, if any is provided, is http://example.com/fakerefer.php
Nobody at affinityseries.com will ever know the location of the web page with the link unless somebody else tells them, for the browser certainly won't.
Question:
Did you find this article interesting and understandable? How can it be improved?
Your response is anonymous.
When done typing, click anywhere outside the box. [more info]
Will Bontrager
©2007 Bontrager Connection, LLC Bontrager Connection, LLC
Please note:
Articles on this website are presented "as is". However -
If you have a question about a CGI script, HTML, CSS, PHP, or JavaScript
Ask one of our Experts and you'll have your answer!
Click here for details.