In my previous article Hiding Affiliate links: advantages and disadvantages I was writing about pros and cons of hiding Affiliate links. It’s up to each and every online marketer whether hide affiliate links or not. Here I will tell you how actually you may hide, or mask your affiliate URL, if you decided to do so. There is many different techniques to hide links, here are the most commonly used:
.htaccess file
Your visitor will see a link to one of the files on your website, for ex.: http://www.yoursite.com/product.php and actually this link will forward him to your affiliate URL http://www.merchant.com/?affid=yourname. How can this be? Here’s how: In your www (which is public_html) directory should be file named ".htaccess". If there isn’t - create one. This file you need to edit and add folowing lines:
RewriteEngine on
RewriteRule ^product.php$ http://www.merchant.com/?affid=yourname [R]
Now as you go to http://www.yoursite.com/product.php you’ll get redirected to merchant’s website.
Please note that this does not work for IIS (Internet Information Server). If your website is on Windows Server, make sure your Web Server is Apache, as .htaccess files are not supported by IIS. You may use your web host control panel to set redirects like this under IIS Web Server.
Online service
There it at least few online services you can use to hide your affiliate links, for ex.: TinyURL.com. They replace long affiliate URLs to something short like http://tinyurl.com/lqyzndg.
You also have to keep in mind that for novice visitor this like URL may seem to not related to the product. Experienced one, especially online marketer, may just trace the destination URL and skip your affiliate id.
PHP script
With very basic code you can make a redirect to another URL. Create file with name product.php (or whatever you like, just make sure it has .PHP extention), and put there the following code:
<?php header("Location: http://www.merchant.com/?affid=yourname"); ?>
Put this file on your web host (for example to public_html) and open it with browser: http://www.yoursite.com/product.php. You’ll immediately will get redirected to merchant website.
JavaScript to hide URL
This method is being used for years. It still does helps, not being too powerful trough. The idea is to change link address, appearing in browser status bar on mouse hovered on the link. For example you may show http://www.merchant.com address there instead of your referral link. Here’s example of JavaScript code you need:
<a onMouseOver="window.status=’http://www.merchant.com’; return true;" onMouseOut="window.status=”"; return true;" href=”http://www.merchant.com/?affid=yourname″> http://www.merchant.com/</a>
Keep in mind that right-clicking the link shows actual URL in status bar. Some visitors may have JavaScript disabled.
CMS component or Blog plugin
Depending on what CMS/Bloging sowtware you use, you may look for ready made plugin for this particular purpose. For example WebLifeLive.com uses WordPress engine. There is at least few plugins available for hiding affiliate links.
Also don’t forget to make google happy with using noindex and nofollow in your links.
July 22nd, 2008 at 2:48 am
Thanks.
August 3rd, 2008 at 8:37 am
Thank you
August 13th, 2008 at 11:18 am
I found your site on technorati and read a few of your other posts. Keep up the good work. I just added your RSS feed to my Google News Reader. Looking forward to reading more from you down the road!
August 14th, 2008 at 10:05 am
Your blog is interesting!
Keep up the good work!
September 24th, 2008 at 3:33 am
favorited this one, brother
September 24th, 2008 at 10:05 pm
Very useful information. Is there any way to make the javascript cloaker work in joomla (which tends to strip out any javascript code)?
September 28th, 2008 at 11:17 am
favorited this one, guy