Hiding Referrer Information
When you click on a link, the web page where your browser goes to knows where you came from. The information is also in the server logs.
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 to web pages on other domains.
Maybe it is a page for only certain people, or just for yourself. Maybe it's a download page. For whatever reason, the page needs to be secret.
When a link is clicked on the secret page, your secret page is no longer secret. Because it is the referrer, the destination web page, and the domain's server, know where your no-longer-secret page is located.
Ouch.
A relay script can hide the URL of the web page with the link. The referrer then is either the relay script or the information is missing altogether. Your secret page is no longer recorded as the referrer.
Here is a PHP script that does the job.
<html><head> <meta http-equiv="refresh" content="0; URL=<?php echo($_SERVER['QUERY_STRING']) ?>"> <script language="JavaScript"> window.location="<?php echo($_SERVER['QUERY_STRING']) ?>"; </script> </head><body></body></html>
Save the above with a file name ending with .php and upload it to your server. Make a note of its URL.
Change the links in the secret page so the URL is the PHP relay script's URL with "?" and the destination URL appended.
As an example, let's suppose this link is in your secret page:
<a href="//www.willmaster.com/blog/">Really good stuff.</a>
Let's suppose the PHP relay script you installed is at URL
The link to
<a href="http://example.com/relay.php?https://www.willmaster.com/blog/">Really good stuff.</a>
When the link is clicked, the browser is taken to
The browser is redirected to
The referrer, the URL of relay.php, may include the "?" and destination URL. The destination URL is where the browser is going to, not where it is coming from. The location of the secret page is still safe.
No scripts or logs at the destination domain knows or records the location of the secret web page because of that click.
The relay script can be used for any number of links. Simply link to the relay script with "?" and destination URL appended.
Counting Clicks
It may have occurred to you that so long as a script is involved anyway, it could be updated to count clicks.
That's right. It could.
But no need to go to all that work. A PHP script to do that is already made.
It hides the URL of the web page with the link.
It relays the browser to the correct destination.
It counts clicks.
It shortens URLs.
It hides affiliate links.
It hides mailto: links.
It's guaranteed.
The script's name is Go Short URL Pro.
PHP. MySQL. Relatively easy to install. Relatively easy to use. More elegant URLs. A good deal at $35.
To hide the referrer information of secret pages, use a relay script such as the one provided in this article.
Or get all the other benefits by using Go Short URL Pro, instead.
Will Bontrager