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.
.htaccess
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$ http://johnchow.com?ref=justin [R]
“RewriteEngine on” just turns on the mod rewrite program. As you see, url.com/john.php 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 johnchow.com website</TITLE> <meta
http-equiv="refresh" content="0; url=http://johnchow.com?ref=justin">
</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:
<?
header("Location: http://www.johnchow.com/?ref=justin");
?>
Save it and that’s it. Now url.com/john.php will now take you to johnchow.com/ref=Justin. 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="http://www.mypcrig.com" onclick="parent.location.href=’http://www.johnchow.com/?ref=justin’;
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.

- Posted in Make Money Online, The Net
- 54 comments what's your take?
Sorry, the comment form is closed at this time.
















LOL! Damn that’s evil…but it’s quite true. Most people don’t want to benefit others and are less likely to click on stuff with affiliate codes.
Reply to this commentVery true Ed, some people may even just mouse over the affiliate link,and then type it in to their browser. Stripping out your affiliate code.
I’ve done that before, when I found a link on a spam site loaded with affiliate advertising and other ads.
Reply to this commentI’ve done that before too, by the time I even did not know what an affiliate link was.
Reply to this commentVery nice trick. I knew there was a way to do it but I didn’t know that people would click on them more if you did it. I don’t personally care if someone gets paid for recommending a good product to me.
Reply to this commentYeah I don’t mind affiliate links if the site actually helped me.
I usually only strip out affiliate code if the advertiser is doing something shady.
Reply to this commentAnother kick-ass way is to buy mis-spellings of the site. For instance http://www.CopeacAds.com
Reply to this commentAnother one would be to use a url forwarding site like tinyurl.com
Reply to this commentTrue, however people are starting to catch on to that. Plus a URL from your site is more creditable and more likely be clicked.
Reply to this commentAhhh… you are missing my favourite link hiding trick of all!
test link to google
When they click it instantly changes the HREF to yahoo and also preserves referrer.
Enjoy.
Reply to this commentI don’t get it…
Reply to this commentit didn’t work for me.. nice trick though
Reply to this commentThanks to Justin and John for the tips. I will have to keep them in mind when it comes time to monetize the site.
Reply to this commentDo any of the common programs forbid it? The language of those ToS agreements can be pretty hard to figure out.
Reply to this commentI use PHP direct!
Reply to this commentthanks john, some times we forget the code
Reply to this commentHow many times are you going to rehash the same garbage? I haven’t seen a quality post from you in months.
Reply to this commentHow times are you going to ask the same question? I haven’t seen a quality comment from you in months.
Reply to this commentJohn,
LOL
1)Regarding aff do you have something for blogger (blogspot.com) ???
2)Where is harpzon?
Nice post anyway.
Reply to this commentOf course, if people strive to produce quantity, and do it fast, this is what you get. Did you hear about the GIGO effect? Yet, Scott is not right regarding the quality. And he is free to go read something else at any given time, if he’s not happy.
Reply to this commentThe solution is simple Scott, stop reading and visiting this blog!
I don’t know why you’re still coming here if you haven’t seen anything interesting in months.
What’s up with all the haters lately?
Reply to this commentIsn’t that the way it goes? The more successful someone becomes the more likely there will be folks who resent that success. I prefer to admire John for his originality and focus.
Reply to this commentyou don’t like it … don’t read it.
Reply to this commentAt the end of the day, it really is that simple. It’s even easier than changing channels.
Reply to this commentGreat tips.
Reply to this commentvery interesting trick, involves some technical-skills
evil!!
Reply to this commentBy the way, congrats on the new PageRank, looks like it’s 6 now.
Reply to this commentSome good ones here. New 2 me.
Reply to this commentI don’t monetize yet, but I would go with the PHP page.
Reply to this commentFrom a web developer’s perspective the header() redirection using PHP sounds like the best one.
Reply to this comment.htaccess file work to make spider rewrite our url.. :D. add robots.txt too file to the spider will more crazy..
Reply to this commentI create a HTML file for each of the aff product I m promoting.
Reply to this commentYes, that’s the method we use too!
I don’t know if one of these other methods would be more useful though…
Reply to this commentI like this JS better:
href=”http://redirect.com/redirect/” onmouseover=”this.href=’http://www.domain.com/’;” onclick=”this.href=’http://redirect.com/redirect/’;”
Reply to this commentJust remember if you are using the header() function in PHP you must make sure you do not have any output to the browser prior to calling it.
Else it will give you the infamous Headers Already Sent error message which will drive you insane!
I also like to use exit(); after a header(); because it stops the rest of the script from executing on the server.
Reply to this commentWhen using the PHP version above, don’t forget to include the ? .
Reply to this commentThe link should be http://www.johnchow.com/?ref=justin
oops, thanks for pointing that out.
Reply to this commentWow, this is sneaky. Very slick though. You can always use the same link and not worry about looking up affiliate code or storing it somewhere. I wonder if this is a bit on the unethical though…hmmm? I guess it is not like they are out any money, they just think they will be directed to a page where you are talking about it.
Reply to this commentJohn - Great post! As a newcomer to Wordpress and a hosted environment, I appreciate tips like these. So much great stuff to learn.
Reply to this commenthm this is getting a bit too technical for me
Reply to this commentwill definitely ‘try’ to apply those tips, i was just wondering about that, so that post comes at the right time
Reply to this commentGreat tips, I know that I personally always look to see if someone is profiting off of my ADD clicking. I’ll certainly be using these quality tricks! Thanks John!
Reply to this commentit’s good to know, thanks for the tip, john
Reply to this commentTechnical yes, I always wondered how John did that trick! Now we know!
Kenneth
Reply to this commentOr you could use script called Shorty that I blogged about here. It will shorten long urls as yourblog.com/keyword/
Reply to this commentIf someone clicks on http://www.johnchow.com/go/tla.php, the landing page becomes http://www.text-link-ads.com/?ref=35183
Is there a fix to that? I don’t want the ?ref=35183 to appear on the landing page.
2) Also… where can I get a redirection script similar to http://www.creditcard321.com/go/dscpla.htm
I like the “bar effect”
Thanks,
Reply to this commentMike
excellent!
Reply to this commentWith my blog i really don’t need to hide the affiliate links because most don’t even know the meaning, because their first concern is fashion.
Clothing Line
Reply to this commentGive me the ASP redirect…
Reply to this commentThe first method is certainly the most classy…
Although nothing groundbreaking…
Reply to this comment