How to Cloak Affilate Links

August 24, 2008 by Reba  
Filed under Affiliate Marketing, Blog, Website Appearance


Selling affiliate products is a great way to make money online and I’m sure that’s exactly what many of you do, plan to do or will figure out that’s what you need to do. I’ll cover what affiliate marketing is in another post but for now I want to make a simple post to explain what I do to hide my affiliate links.

Whenever you become an affiliate for a product or company, you will receive a specially coded link that when used by a website visitor, it will set a cookie on that visitor’s computer to tell the product owner or company that your website or you referred the visitor to them. If that visitor buys something, you will earn a commission. The link is an integral part of the process as that’s how the company paying the commissions knows to pay YOU.

For the most part, the links that are assigned are long and ugly. To top that off, some people will not use the link, they remove the code that identifies you as the affiliate. In order to “fix” that, the best way I know is to “cloak” the link. Here’s how:

  1. Create a directory on your site called “info” (or whatever you want to call it). In the “info” directory, create a directory for each of your affiliate links. For example, create a directory called “info” at yoursite.com/info and a directory in the “info” directory called “revolution-theme”.
  2. In the “revolution-theme” directory, put a file called .htaccess — create this file using a plain text editor like Notepad.
  3. This file will only have one line in it and it should look like this:
    Redirect /info/revolution-theme https://www.e-junkie.com/ecom/gb.php?ii=67579&c=ib&aff=33340&ev=4cdd29eca7
  4. Note that there are three parts to the line and it should all be on one line (it may wrap in the browser here on the blog): the Redirect command, the location of the directory you want redirected relative to the root of your site (/info/revolution-theme) and the full URL of the location you want that request sent to (the affiliate link). Each of the 3 is separated by a single space and all on one line.
  5. Upload the .htaccess file to the directory you made for that affiliate. In the example here, you would put the .htaccess file in the revolution-theme directory.

So, if I were to give out the URL http://www.yoursite.com/info/revolution-theme the link would send visitors to revolutiontheme.com using your affiliate code.

There are a few things I want to mention regarding this process that may cause some mix-up. First, when you make the file in Notepad and save it, the file may save as .htaccess.txt. You will need to change the name of the file to exclude the .txt if you want it to work. Also, be sure it has a dot (.) in front of it.

Second, when you upload it to your server, it is considered a hidden file. You may need to change the settings on your FTP program to show hidden files if you want to see it in the directory.

Post any questions in the comment section.

Reba

Post to Twitter Tweet This Post

No related posts.

We'd love to hear your comments!

Comments

7 Responses to “How to Cloak Affilate Links”

  1. jack parler on March 8th, 2009 1:11 am

    This is nice. Thank you :D

  2. Rev Jeff Lewis on March 26th, 2009 12:55 am

    Just a side note to your post, if you use wordpress, there is a tinyurl type plugin that makes this even easier, or there is also a firefox plugin that does tinyurls for you. Just a thought to add.

    Rev Jeff Lewiss last blog post..Captcha woes

  3. Reba on March 26th, 2009 6:02 am

    Thanks Jeff.

    But do those plug-ins allow you to change the affiliate link if the program changes the the link they provided for you? That’s happened to me and all I had to do was change the link in the re-direct file, that updated every link on my site or even on the internet. And can you make the link “look” any way you want or does it just create a link like the ones you see on Twitter? There’s a lot of value in using a link that has your website in it. People have more trust in it and will click it more often.

    If the plug-ins allow this kind of flexibility then they would provide a much easier way to do this, but if not, taking the extra time to do it as described above is well worth it.

  4. Richard Linder on February 11th, 2010 7:39 am

    Good way to hide affiliate links.

  5. Chasey on February 13th, 2010 10:33 pm

    I have been trying to find instructions I can follow, but to no avail! I would like to learn to cloak my affiliate links (up to now, I just haven’t.

  6. Jay on April 28th, 2010 11:27 am

    Excellent post. Good points made. Thanks for this.

    Does the cloaking technique really work though? I’ve tried it with http://teamincome.co.uk/infinity.htm and as you can see the Aff link still shows up in the address bar :(

    I’ve tried everything for this.

    Safer Online Promotion

  7. Zac on February 26th, 2011 5:09 am

    Thanks for all your info

Twitter links powered by Tweet This v1.6, a WordPress plugin for Twitter.