How To Effectively Cloak Your Affiliate Links

Posted by Nick Niesen on October 26th, 2010

Affiliate links are something we all have to live with in internet marketing, but unfortunately we sometimes find that unscrupulous people hijack them. Even if they don't hijack them, some people will just strip the affiliate part in order to deprive you of a commission. They don?t even save themselves any money or gain anything out of this other than some perverse pleasure in ripping someone off.

Whilst there are programs out there that will cloak your links and also track the click throughs, here's an easy way that you can employ on your own web site to both cloak your links and also improve the presentation of them.

Before I get onto that, can I just say that there are other methods such as using Tiny URL, but personally I dislike these type of links. They almost scream "Hey, look what I'm trying to hide". I feel that this method is not only effective, but also provides great presentation and a recommendation from you as the web site owner as well.

OK, here we go.

Let's assume that we are going to cloak the following link:-

http://www.the-greatest-product-ever.com/affiliate-area/start.php?offer=youraffiliate-id&pid=1

The first thing to note about this is that it is very long and ugly. Another danger with this link is that it could "wrap" in a text based email and lose its click through ability.

So what do we do?

OK. Open Notepad or a similar text editor or you can use Dreamweaver if it's configured to run php files because we are going to write a very simple and straightforward php file.

In your editor type the following on a blank page. That's very important. If you are using a HTML editor, make sure there is nothing on the page.

Insert Less Than Sign Here?php
header("Location:http://www.the-greatest-product-ever.com/affiliate-area/start.php?offer=youraffiliate-id&pid=1");
exit();
?Insert Greater Than Sign Here

That's it. Yes, it's as simple as that.

Now, save the file into a directory on your web site. I would suggest a sub-directory name "recommends" and upload the directory and file to your server.

The first thing to do now is to test the file to make sure it works as it should. Whatever you do, NEVER send out an email or put a link on a page that hasn?t been tested.

In your url address bar type:- http://www.yourdomain.com/recommends/filename.php and it should take you direct to the page of the affiliate product that you are selling. It bypasses your site entirely so people don't see all the affiliate code in the php file.

Once you have tested the page and you are sure it works, you are ready to incorporate the page in an email to your list or even onto your web pages directly if you have done a product review or similar, but the link of course will be:-

http://www.yourdomain.com/recommends/filename.php

I think this looks so much nicer than a terribly long and convoluted filename and certainly much less secretive than a Tiny URL. It is also stating in the url that you "recommend" the site.

I employ this method on all my web sites and in my emails to people and with great success. I hope you enjoy the same.

Like it? Share it!


Nick Niesen

About the Author

Nick Niesen
Joined: April 29th, 2015
Articles Posted: 33,847

More by this author