How to double meta refresh (affiliate cloak linking).

Status
Not open for further replies.

Sharksfan

New member
May 28, 2009
1,088
22
0
WI
I had to learn this today so I thought I'd explain how it works in newbie talk.

Keep in mind this is explained elsewhere but if you REALLY are new to this whole thing this should help you a bit more.

Double meta refresh both...
  • hides your referred
  • cloaks your links
Here's how to do it.

Let's say you have a site name Website Hosting - Mysite.com

  1. Create a directorly at the root called something like /go or a generic sounding name
  2. Create two files and upload them to that directory. For the sake of demonstrating I'll call them 1.php and 2.php
Contents of 1.php are:

<?php
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://mysite.com/go/2.php\">";
?>

Contents of 2.php are:

<?php
$referer = $_SERVER['HTTP_REFERER'];
if($referer == "")
{
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://LONG-ASS-AFFILIATE-LINK-GOES-HERE\">";
}
?>

Obviously your long ass affiliate link goes where LONG-ASS-AFFILIATE-LINK-GOES-HERE is. Leave the \ at the end.

In your HTML code instead of an affiliate link then just put this:

<a href="www.mysite.com/go/1.php">Linky</a>
 


I have read guides where people use different domains for double meta refresh. Does that make a huge difference in how hidden the referred link is? Also, what is your take on using an ssl certificate for you're tracker instead of double meta refresh?
 
Not really relevant, but instead of writing this:

{
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://LONG-ASS-AFFILIATE-LINK-GOES-HERE\">";
}

and as long as you're not trying to evaluate any variables inside the string, then you could write this:

{
echo '<meta http-equiv="refresh" content="0;url=http://LONG-ASS-AFFILIATE-LINK-GOES-HERE">';
}
It's marginally quicker to parse and, imo, much easier to read. And you're less likely to have problems missing /escapes in complex strings.

Back on topic.
 
Status
Not open for further replies.