Hiding Affiliate links: advantages and disadvantages Google PageRank (PR) formula
Jun 27

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.

This related posts might be also useful

  • Hiding Affiliate links: advantages and disadvantages
    There is different opinions on subject. Some people believes that affiliate links has to be visible, to be honest that this link is actually makes some financial income ...
  • The value of affiliate links
    Over the web we all met links to a website with affiliate code in it. Some of us notice this codes, some doesn’t, and some does remove them. Those, who removes affiliate...

One Response to “Hiding Affiliate links: techniques”

  1. website-builders Says:

    Very useful information. Is there any way to make the javascript cloaker work in joomla (which tends to strip out any javascript code)?

Leave a Reply