the Blogoholic

How to Cloak Your Affiliate Links and Make More Money

I’m pretty sure that many of you know how cloaking your affiliate links can double, or even triple your conversions. But have you ever wondered how or why?

Why? Simply because when a potential buyer sees that ugly referral link he is about to click, it will immediately hit him that you are only promoting the product to make a quick buck.

But seeing a URL that looks like this: john.com/go/google.php will most probably cause him to click the link without thinking twice.

How? Although there are numerous ways to cloak an affiliate link, I find that using a PHP redirect works best. After you finish reading this post, you’ll know how to create links like the one above and redirect them to your affiliate page.

Step One

Create a new directory in the root of your website (public_html) with the name you’d like to appear in your cloaked affiliate link.

For example, if you wanted your link to look this: john.com/go/google.php, then create a new folder named “go”, or “recommends” if you want it to look this: john.com/recommends/google.php

Step Two

Now that you’ve created your new folder, open your favorite text editor and paste this code into a new file:
<?php
header('Location: http://www.youaffiliatecodehere.com/');
?>

Substitute the URL with your own affiliate and then save the file as filename.php (eg. hosting.php) That’s it, just repeat the second step to make as many cloaked affiliate links as you’d like.

The reason why this method works better than a .htaccess redirect or JavaScript code is because you can link to the file on other websites and can change the content of the file without having to worry about changing each individual URL.

This tactic probably won’t do you any good in the Internet marketing niche, as its members are constantly on the lookout for these tricks, but it will most certainly work wonders in the other niches.


, , ,

Updates, Fresh From the Oven, Straight to Your Inbox

Don't worry, we hate spam, too!

33 Brilliant Reader Comments, Comment or Ping

  1. G’dang!

    I was just searching for this, thought it was a plugin.

    Helpful post for me, thanks! :)

  2. the Blogoholic

    Swastik - I actually wrote this post because of the question you asked me yesterday!

  3. That actually is pretty cool. I had no idea on how to do this.

  4. the Blogoholic

    Klajdi - I’m glad you found it useful!

  5. Rajaie, Wonderful gesture, mate.

    Thank you! :)

  6. Nice post Blogoholic. There are a few programs that will simplify that process but you outlined a nice free way of doing it. Thanks for sharing.

  7. There is also a pluggin for this to do thing simple rather than to create php files.. Its called gocodes.. a remarkable plugin i use.. it can mask links n shorten url.. check my site for how i mask it.try it.. u ll lik. have fun!!!!

  8. the Blogoholic

    Swastik - No problem.

    Brian - I don’t think that a program could simplify the process - maybe make it easier and faster, but not “simpler”

    Arun - There’s also a plugin called Affiliate Ninja, but most of these plugins are expensive, will check yours out right now…

  9. Wat i said was free.. u can download from wordpress.org

  10. Good tip. Till now, I have preferred using .htaccess redirects but this one is nice too. The only thing that matters is that the link should look good enough for the user to click on it.

    Keep up the great content.

  11. the Blogoholic

    arun - I know, I was just mentioning some other similar plugins ;)

    Ganesh - .htaccess are pretty nifty and easier to maintain; I guess it just depends on your personal flavour.

  12. Don forget to noindex / nofollow the pages though! I personally use the following layout:

    WebSite Name

    window.location=”http://thelink”;

    You are being taken to the correct page.
    If the page doesn’t load after 5 seconds,

    click here
    .

  13. seems like the comment box ate the code :p so here it is again get rid of all the *
    Don forget to noindex / nofollow the pages though! I personally use the following layout:

    WebSite Name

    wind*ow.loc*ation=”htt*p://thelink”;

    You are being taken to the correct page.
    If the page doesn’t load after 5 seconds,

    click here.

  14. dammit raj just hit me up on msn when you read this!

  15. the Blogoholic

    Donace - Hehe, I’ll just buzz you on MSN ;)

  16. That’s a great tip !
    Could you advise could we do with blogger ??

    Dinh Trung
    themondey.info

  17. the Blogoholic

    Dinh - You can do it with blogger by uploading the php file on a separate free host and then linking to it.

  18. Hallo, I’m not familiar with .PHP :)
    Could pm to advise the procedures ??!!

    Thanks for your kind supports in advance !

    Dinh Trung
    themondey.info

  19. the Blogoholic

    Dinh - You can find out how to create the redirect by reading the post.

  20. Hi, it does not work in my case.
    I created .PHP file with notepad (then tried with wordpad) and upload to my host at 110mb, but it does not work !!!

    Please help to advise !!

    Dinh Trung
    themondey.info

  21. the Blogoholic

    What does not work? Does it redirect you at all? What happens when you try access the file?

  22. I create .php file with notepad, it’s automatically add “.txt” end of the file once I saved. And add “.rtf” if I use wordpad.

    I upload the file to 110mb, then rename by deleting “.txt” and/or “.rtf” but it still not work !!

    Dinh Trung

  23. the Blogoholic

    Dinh - Ah, I see the problem. When you are saving the file, you have to select the “All file types” option in the file format field.

  24. That is something new I have learnt. Pretty neat but what is the difference between this code and using the Gocodes plugin?

    Wei Liang

  25. the Blogoholic

    Wei - No difference really, except that you can us the method discussed in this post for even non-WordPress sites/blogs.

  26. If you are in the internet marketing niche, I usually find it is better to not hide your affiliate link and just be upfront about. If you say something like: “here is my affiliate link” then I’m pretty sure people won’t mind.

  27. Blogoholic,

    It’s ok now. However, it should be better if we could hide the affiliate link, then just the original site link apprears :)

    Is it possible ??

    Dinh Trung

  28. the Blogoholic

    Money Whiz - I totally agree with you on that point, it’s only in the other niches that cloaking affiliate links will usually help.

    Dinh - Yes, that can be done with Javascript. Here’s a link if you wanna know how: http://www.jeremyreviews.com/2007/11/16/3-powerful-to-cloak-affiliate-links/

  29. I am using .htaccess file to redirect all affiliate links :)

  30. Nice article..

    All about affiliate programs

    http://moneylocker.blogspot.com

  31. It what i looking for thanks mate!

  32. Nice, it makes it easier than having to change a bunch of affiliate links on hundreds of posts if the affiliate isn’t selling well or disappears.

What Do You Think?