Basic Link Cloaking for Affiliates…

Over the weekend I got involved in a discussion on the Associates forum about the ability/need to use cloaked affiliate links.  Although the conversation there was decidely focused on the Associates program there were a number of good points and questions made.

This is clearly something that is not understood by many affiliate marketers.  So I think this is a good opportunity to take a few posts over the next several days and go over the upsides/downsides of and reasons for cloaking your affiliate links.

I will pay particular attention to the Associates program… although most of this discussion is applicable to all affiliate programs.

If you’ve got a question I haven’t answered please post a comment so everyone can see it and get the benefit of the answer.  I will not answer questions privately via email.

Also, since I’m a programmer, I have to laugh at all the affiliate cloaking software utilities available.  Please… don’t waste your money.  With very few exceptions these tools are just creating very simple http redirects for you.  You might not know what that means… but it’s nothing special and there’s no reason for you to pay for it.  Once I finish this series I’ll make a tool available for free that will do what others are charging for.

Here we go…

What is link cloaking?

At its most basic, link cloaking is just a black-hat sounding term for an http redirect.  An http redirect is just a technical sounding phrase for a link that can easily be thought of as something like a bookmark on the web.

For example, here’s an ultra-simple cloaked link:

Go ahead and type it in or click on it.  You’ll see that instead of that URL coming up in your browser you are instantly “redirected” to the homepage for my <start shameless self-promotion> excellent Site Sniper Pro software. </end shameless self-promotion>

Here’s what’s happening behind the scenes…

ssp.php is a very simple php script that does just one thing… tell the web browser that the page requested has moved.  It takes advantage of the fact that web pages move all the time on the internet.  And search engines and browsers need an easy way to be redirected to the new location.  There’s no trickery of any sort that actually happens (despite what sellers of link-cloaking scripts would have you believe).  We’re just using what’s already built into your browser for a different purpose.  If you pay attention when you’re surfing the web you’ll find these simple redirects all over the place.

Here’s the source of ssp.php:




And here’s what I’ve accomplished using this simple redirect (the easiest form of link cloaking):

  • Made that long, unreasonable URL (my affiliate URL) much more manageable and user friendly.
  • Easily hidden my affiliate ID (85095) and affiliate network ( from basic snooping.
  • Protected myself against the first level of link swiping (or link hijacking).  This will stop about 80% of link-hijacking immediately.  In future posts I’ll get into some of the trickier forms of hijacking that will require more effort to defeat.  For the vast majority of link thieves this is all you need to stop them.  Now do yo see why you don’t need to pay $60 for a utility that does this for you?
  • Kept total control of my affiliate traffic.  For example, I wrote a credit repair guide that I give out for free on one of my websites.  In that guide I link to a handful of credit repair services for which I am an affiliate.  Since the guide is a pdf, if any of those affiliate programs ever go away (or I find a better one) I would be stuck with all those guides with an old (and potentially unprofitable) affiliate link if I had a direct link.  Now I can redirect that link through my own site and if it ever changes the links in the guide will still be good (since I only have to change the new destination on my server).  Make sense?

There are still some weaknesses with this level of link-cloaking… but it’s enough to thwart most link thefts and it gives the added benefit of being much more visually appealing.  Here are two other common ways of achieving the same result with an html page and using your .htaccess file.



<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<meta HTTP-EQUIV="REFRESH" Content="0; URL=">




Redirect 301 /ssp.html


As you can see, basic link-cloaking is very easy to do.  I cloak almost all of my affiliate links with at least basic cloaking.  In future posts I’ll get into more detail about why you would or wouldn’t cloak, how your links and cookies can (and do) get hijacked, and give you some tools to do your own basic and advanced cloaking.

Got questions (even though I already know I haven’t covered everything)?  Post a comment and I’ll try and get them all answered.  Inflammatory and spam comments will not be moderated.

1 Comment Basic Link Cloaking for Affiliates…

Comments are closed.