[HELP] Blanking Referrer

Troshi

Supreme Member
Joined
Aug 19, 2011
Messages
1,231
Reaction score
227
I've got a page set up that redirects to 1 of 5 different urls through a javascript redirect. In my page I've got all the links in t.co/url which refer to bit.ly which end up at a final destination. However, when I looked at the bit.ly/url+ page, it appears that the referrals are from my random redirection html/java page, and not from a t.co/url which is what I wanted. Any help on hiding my url?
 
This is actually a pretty complicated answer as to how to truly do this. It also depends on if you are ok with most of your referrers being hidden, or if you need all of them to be hidden.


The first thing you did (regardless of how you answered that original question) is a double meta refresh.

So you link to "yourpage.php" which has the following meta code:
Code:
<?phpecho "<meta http-equiv=\"refresh\" content=\"0;url=http://www.yoursite.com/page2.php\">";
?>

Then on "page2.php" you have the following:
Code:
<?php
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.t.co/whatever\">";
?>

However if you need 100% of your referrers hidden, you need to change that page2.php file to look something like this:
Code:
<?php
$referer = $_SERVER['HTTP_REFERER'];
if($referer == "")
    {
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.t.co/whatever\">";    
    }
else
    {
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://someotherurl.com\">";    
    }
?>

In this case it checks to see if the referrer really was cleared. If it was cleared it sends the user to their twitter link. If it wasn't it sends the user to some other 'safe' url. In that case you can then have that safe URL also link to the twitter or just do something else.

The reason you need to do that is because some browsers (Chrome and Safari are the two big ones) do not blank the referrer. Unfortunately for people trying to cloak their traffic, Chrome is picking up a lot of market share. When people were doing meta refreshes 2-3 years ago you could expect to only lose 5% of your traffic, while that number is a lot higher now. But that is the price you pay for hiding referrers.


The other way you could also try to blank the referrer is by using SSL but that creates a whole host of new problems as well and is probably more work than you are looking for.

Hope this helped! :)
 
Wow, that was an amazingly detailed post! Thanks! I'm going to test some of this out, and get back later.
 
Back
Top