I used to cloak my links the old-fashioned way, using simple HTML redirects.
The html page would be coded as follows:
<html>
<head>
<title>YOUR PAGE TITLE</title><meta http-equiv=”refresh” content=”0;url=http://YOUR AFFILIATE URL”>
</head>
<body>
<p>Redirecting, please wait. If you're not redirected within a couple of seconds, click here:<br />
<a href=”http://YOUR AFFILIATE URL”>PRODUCT NAME</a></p>
</body>
</html>
The contents of the page would appear like this:
If you are not redirected within a couple of seconds, click here:
PRODUCT NAME
Then I moved to using PHP redirects, one page for each affiliate link, such as the following which would have been linked from http://yourdomain.com/go/affiliatelink1
Here is the code used for that page:
<?php
header( ‘Location: http://affiliatelink1.com' ) ;
?>
Nowadays, I use a much simpler technique that puts all my affiliate links on one php page, i.e. link.php, which resides in the root directory.
<?php
$path = array(
‘affiliatelink1' => ‘http://affiliatelink1.com',
‘affiliatelink2' => ‘http://affiliatelink1.com',
‘affiliatelink3' => ‘http://affiliatelink1.com',);
if (array_key_exists($_GET[‘id'], $path))
header(‘Location: ‘ .$path[$_GET[‘id']]);
?>
To make the links work, you must add the following to your .htaccess file:
RewriteEngine On
RewriteRule ^go/([/_0-9a-zA-Z-]+)$ link.php?id=$1
The links are then called using the following linking format:
http://yourdomain.com/go/affiliatelink1
Note, you don't have to create a ‘go' folder and you may call it anything you like, i.e. recommends, go, links… whatever.
For example, if youed want to use ‘links' rather than ‘go', then change ^go/ to ^links/
And that's how to cloak your affiliate links the easy way!
Comments, questions or suggestions? Please leave a comment below!
Cheers,
Ros
Thanx for sharing, im a complete newbie to affiliate marketing i follow some of what your saying, i will have to look more deeply into it, thank you
Cool… Thanks for sharing…
Why not just use the GoCodes plugin for WordPress? Works like a charm, and very easy.
Hey Ros,
Never did understand the whole affiliate cloaking stuff. Looks so easy when shown like that. Will have to give it a try.
Thanks for sharing
Simon
Good Tips.
I’ve never cloaked my affiliate links before, is it really necessary?
How much do you benefit from it?
Thanks. I was looking for a way to cloak my links from for affiliate products. This is quick and easy. All the best, Buddy
Hi Rosalind, very good information. I’ve been using pretty link for about 4 months now, and it’s great. It’s a WP plugin, and it displays all of my affiliates on one page and tracks every click and unique click. I love it.
I have been putting up a page for each redirect and had wondered if there was a way of having them all on one page. You have just made my life that much easier. Thank you so much!!
It is just what I have been looking for 🙂
I have tried it and its working great!
Thanks a lot!
Lydia
Hi Ros
I love this idea , and will be implementing it straight away! Thanks for the great tip!
Steve
Thanks for sharing this info! This tip has just saved me a ton of effort and helps organize my affiliate links in one place. I appreciate you taking the time to make this info available.
Hey Rosalind,
I use the html version my self but these other ways give far better looking links.
Great post will be using the php redirects anymore
Thanks
Glyn
I learned how to use a small text file that contains a redirect script and my affiliate link that I name whatever I want and save in my root directory. This cloaks the url but I have to create a text file for each link. Now I am considering purchasing Powerlink Generator because it also allows you to keep track of all the other affiliate information in one place as well (affiliate login, password, commission, etc.) Has anyone used this program?
Hi Rosalind.
I use a simple html redirect at first but i find the php redirect is much better.
Or you can use bit.ly , offto.net or similar software to hide your affiliate links.(never use .tk ).
Is affiliate link cloaking away to protect your links from link theft?
@Marcus,
Absolutely! If someone sees the affiliate link in the address bar (before clicking on it) they can replace your affiliate id with another one, and you will lose the sale. This is especially true with clickbank A-ids because they are easy to spot. So you have to make sure that your redirect and also cloak it so it doesn’t appear.
Thks for your tips!You’re great
Hi Rosalind,
I like the new cloaking method you suggest. The PHP redirect I think works well when you only have a few affiliate links, but having to create a page for each affiliate link is a bit time consuming.
I also use the Pretty Links WP Plugin. All the links are on one page and simply adding the original affiliate link is needed to create the cloaked link.
Are you familiar with Pretty Link and what are your thoughts on it?
Thanks,
Ken
Funny, I followed a similar path on my “affiliate redirect journey”. I remember a webmaster clued me in to that “keep it all in 1 file” method, and then when I eventually started coding in PHP, I began implementing that idea.
One can also take this further if necessary, such as doing any security checks within that 1 master PHP redirect file, choosing 301 vs 302 redirects, email notifications, IP/bot blocking, etc. Yeah, all geeky stuff with possible applications depending on circumstances. But, the basic strategy itself works fine for most people and is a lot “cleaner” than an HTML meta-refresh.
-Jake
Hi, Ros!
Thanks for sharing!
As for me, those affiliate links of mine that I cloak, I make use of the service provided by:
http://www.tinyurl.com
What do you think of this method of cloaking affiliate links?
Many internet companies do not allow affiliates to use redirect pages. Why is that?
May be not so easy as it seems, for some (or many) of us.
Could be interesting stuff for a more extensive article…
Anyhow, it keeps us ‘on track’.
Thank you!
P.S. Everything alright with you puppy?
Hi Rosalind,
Thank you for share, however why you don’t use some of WordPress plugins for redirection? For example I use Redirection plugin http://urbangiraffe.com/plugins/redirection/ and it works great. I think it’s more convenient to use a plugin, especially for people who don’t familiar with php.
Best wishes,
Vicky
Not being a techie I’m always grateful for this kind of post. I’m still using my old link cloaker which is a bit quicker than manually creating pages.
All The Best
Al
Alex,
If it is okay with you, I would like to know your old link cloaker technique. It’s been some time since i’ve used html code(since high school actually) so I’ve been refreshing my mind on html. If you could show me your “quicker” way to cloak the link, I would be really grateful.
Best Regards,
Steven
Thanks for the tips I always wondered how to cloak my affiliate links correctly. Great tips I am gonna implement them into my affiliate marketing campaign.