Website Magazine

Re-directing Affiliate Links

Re-directing an affiliate link or ‘cloaking’ a link is an easy task and can be a great advantage to your site for good reason.

As I have done on this site, many other sites link to domain/name-of-product/ and redirect either using a PHP jump script (as do I) or manipulate the htaccess file.

What are the advantage of redirecting an Outbound Affiliate Link?

  • Keeping others from stealing affiliate sales and making it harder for “newbies” to see how to access the affiliate program or view it is an affiliate link.
  • Easily change the merchant offer by changing only one affiliate link within your php redirect file or .htaccess. It’s especially helpful when you’ve sent out an email, newsletter or posted a link on a forum and a merchant has changed the link. You can easily change the redirect on your end and keep the affiliate sale alive.
  • Increase confidence of clicking on an affiliate link as many people are hesitant to click on links that look like: http://www.tkyrse.com/affiliateid?12345
  • Protect your affiliate links as many will hover over an external link and manually type in the top level domain in the address bar of browser instead of clicking on the link. It seems pretty silly as the site’s owner has gone through the trouble of finding valuable information for free, as the actual click doesn’t cost the reader anything.

There are some instructions on the web to set up a redirect by using .htaccess/301 redirects or php scripts that may appear confusing or overwhelming to a handful of site owners. There are also many software products on the market that charge $20-$60 to assist in protecting your affiliate commissions. But…actually, hiding your affiliate links can be so easy.

Using PHP

Create a file in notepad and call it moneynow.php and enter this:

<?
header(“Location: http://www.susansuarez.com/ref=2424538″);
?>

Of course, change the URL to be your affiliate link and upload the file to your server and use moneynow.php as the new link. So in this case it would be: http://www.susansuarez.com/moneynow.php. Now anytime anyone clicks on this link they will be redirected to the actual affiliate. Very simple, huh?

You could even create a directory called “information” or “recommended” that may add more trust to the link and will appear like this: http://www.susansuarez.com/recommended/moneynow.php

But before hiding an affiliate link, review your affiliate’s TOS and make sure it doesn’t forbid cloaking.

Using .htaccess

.htaccess is located in the same folder as your index.html or .php files. Open it up and at the bottom of that file, type this (Example):

RewriteEngine on
RewriteRule ^moneynow.php$ http://susansuarez.com?ref=2424538 [R]

“RewriteEngine on” turns on the rewrite program and the affiliate link will be redirected.

Additional Cloaking

There is a free tool and easy way to further cloak your links from those who hold a mouse over a link to view the destination. Check out ClickFire to automatically add the coding needed to hide the destination, even a .php link, if you want that hidden from experienced marketers aware of php cloaking techniques. Just make sure your links are a different color than your other text so people know that it’s a link to click. Blue is a good standard color to use.

Robots.txt

To keep search engines issues at bay with creating a cloaking page, it’s highly recommended to keep Google from indexing pages that have nothing on it and are used only as a redirect. Google doesn’t like these pages and you wouldn’t want Google to index the page anyways, since it won’t have any content.

Save all of your redirects within one directory and exclude that directory in your robots.txt. If you don’t have a robots.txt file, you can create one in notepad and upload it to the root directory of your web page. The robots.txt file gives spiders a direction as to which directories or files they can examine and retrieve information. To prevent them from accessing any part of the site (including redirects with no content), enter the following within the robots.txt file:

User-agent: *
Disallow: /folder-to-be-excluded/

The asterisk (*) indicates “all” spiders or agents. If for some reason, you want to disallow access to any directory, then use a forward slash “/” and not an asterisk for “Disallow: ” To read more on robots.txt, take a look at

Cloaking your affiliate links should increase conversions, for many reasons noted above. There is no need to lose out on money by not ‘hiding’ affiliate links!

Posted under: Affiliates, Blogging, Tools

12 Comments

  1. Paul Bradish says:

    Excellent post Susan! I’ve been really slacking in this area and need to start re-directing my affiliate links. There is some very useful information in this blog entry and thank you again :).

  2. David says:

    What happens if you screw up the htaccess file? Do you recommend this to beginners!? How does someone steal an affiliate sale if that person doesn’t have access to the website?

  3. Thanks for posting this Susan…I’ll be working on redirecting my affiliate links these next few days :D Appreciate it!

  4. Susan says:

    Paul – No problem!

    David – Well, this has happened to me before and I can’t remember exactly what happened, but there was an issue with landing on the site. Always make a backup copy of anything you change so that if it doesn’t turn out the way you wanted, replace the file with the old copy. As far as stealing commissions, it’s more from people who decide to use their own affiliate/referral id’s to replace yours with theirs, essentially changing where the commission goes to (product sales…..)

    Gregg – Cool :D

  5. shaun says:

    this is a great technique I’ve seen many bloggers do pleanty of times. thanks for the hint!!

  6. How about html redirect Susan, you forgot to mention about it I think. It’s nothing but similar as PHP redirect but this is with some html code which helps to show “You are redirected to the site in 5 seconds or click here” incase page does not show up quickly due to any technical issue

  7. [...] Re-directing Affiliate Links – “Re-directing an affiliate link or ‘cloaking’ a link is an easy task and can be a great advantage to your site for good reason. As I have done on this site, many other sites link to domain/name-of-product/ and redirect either using a PHP jump script (as do I) or manipulate the htaccess file. What are the advantage of redirecting an Outbound Affiliate Link?“ [...]

  8. [...] Suarez tells us how to “cloak” our affiliate links. This is basically another term for hiding our links. This helps increase affiliate sales and [...]

  9. If you want to manage all those hidden affiliate links from a nice web interface inside wordpress admin you can use my new ( and free ) plugin.
    you can find out more about it here: http://patchlog.com/wordpress/hidden-affiliate-links/

    The “Additional Cloacking” will not work on all browsers because some have the security settings in such a way that they don’t permit scripts to change the text in the status bar. I think IE 7 has such settings by enabled by default

  10. Good development buddy, I would give it a try.

  11. great post.. hey.. susan.. i know you live in SD.. are you down for a video log?? I live in OC.. shouldn’t be too bad..

  12. Dm says:

    Why is all the tech stuff always for people who already know what to do?
    I don’t understand a word of how to start this – as a newbie, and I am not the only one, I’m sure, there must be a step-by-step way of explaining all this?

    I’m sorry I logged on here now :(

Leave a comment