How To Hide Affiliate Links

I wrote about hiding affiliate link for better SEO last month. However, the method I wrote about is just one of many ways to hide an affiliate link. I asked Justin from MyPCRig to share a few other ways to hide an affiliate link. This is what he came up with.

As John has mentioned more than a few times on this blog, people are more likely to click on a link if it doesn’t contain an affiliate code. To help you increase your affiliate signup rate, I’ve come up with a list of ways to hide an affiliate link. Keep in mind that there are many ways of doing this. I will be highlighting some of the popular techniques. As always, please read your affiliate program’s TOS and make sure this doesn’t go against it. Some programs have no problems with you hiding an affiliate link while other programs strictly forbid it.


This is a great file to get to know, if you’re using linux. .htaccess is located in the same folder as your index.html or index.php files. If not, you can create one.

Open it up .htaccess and move to the bottom of that file and type this in:

RewriteEngine on
RewriteRule ^john.php$ [R]

“RewriteEngine on” just turns on the mod rewrite program. As you see, will be redirect to John’s website, plus it will contain your affiliate code. This is a very easy way to hide your affiliate code and you just need to edit one file.

HTML Redirect

Another easy way to do hide your code, that doesn’t require a certain OS. Create a file called john.htm and type this in.

<HTML><HEAD><TITLE>Taking you to website</TITLE> <meta
http-equiv="refresh" content="0; url=">
</HEAD> <BODY>Please stand by.</BODY> </HTML>

You just need to create a new HTML file for each of your affiliate program.

PHP Direct

If you have PHP install on your server, then you can use this technique. With
PHP there is a lot of different ways of doing this, but for the time being, I’ll
show you the super easy way.

Create an file called john.php and type this in:


Save it and that’s it. Now will now take you to As with the html way, you will need to upload a new file for each of your affiliates.

Javascript Redirect

This technique will work great on websites, however not in blogs with rss
feeds. Also if a reader turns off javascript, it will take the user to the url it’s
showing. Please note: Google bot has javascript turned off. If the user tries to
open it in a new browser or tab, it will not go to the hidden url.

<a href="" onclick="parent.location.href=’’;
return event.returnValue=false">Mypcrig</a>

These are great ways to increase your affiliate conversions. They might be a
little evil, but it’s a great way to make money online.