• About
  • No BS News
  • Rosalind's Training Programs
  • FAQ
  • Contact
  • Home
  • Articles & News
    • Build Your Site
      • Blogging
      • Design Tips
    • Content is King
    • Find Your Niche
    • Get Traffic
      • Article Marketing
      • Email Marketing
      • Pay Per Click Advertising
      • Search Engine Marketing
      • Social Networking
      • Video Marketing
    • Learn to Sell
    • Make Money
      • Affiliate Marketing
      • Affiliate Networks
      • Affiliate Programs
      • Google Adsense & More
      • Merchants & Managers
      • Other Bizops & Jobs
      • Sell Your Own Product
    • Manage Your Money
    • News
    • Success Tips
    • Videos
  • Beginners
  • Polls+
    • Contests
    • Just for Fun
    • Polls
    • Ros' Personal Notes
  • Resources & Reviews
    • Deals & Discounts
    • Product Reviews
    • Tools
      • Affiliate Tools
      • Content & PLR Sources
      • Datafeed Tools
      • Keyword Tools
      • List Building Tools
      • PPC Tools & Services
      • Productivity Tools
      • Site Tools
    • Training
      • Ros' Speaking Agenda
      • Seminars & Webinars
      • Tutorials
    Home > Affiliate Marketing, Design Tips > How to Cloak Your Affiliate Links the Easy Way

    How to Cloak Your Affiliate Links the Easy Way

    Written by Rosalind Gardner  

    Print Print  Email Email  25 Comments

    I used to cloak my links the old-fashioned way, using simple HTML redirects. The html page would be coded as follows:

    <html>
    <head>
    <title>YOUR PAGE TITLE</title>

    <meta http-equiv=”refresh” content=”0;url=http://YOUR AFFILIATE URL”>
    </head>
    <body>
    <p>Redirecting, please wait. If you’re not redirected within a couple of seconds, click here:<br />
    <a href=”http://YOUR AFFILIATE URL”>PRODUCT NAME</a>

    </p>
    </body>
    </html>

    The contents of the page would appear like this:

    If you are not redirected within a couple of seconds, click here:

    PRODUCT NAME

    PHP:

    Then I moved to using PHP redirects, one page for each affiliate link, such as the following which would would have been linked from http://yourdomain.com/recommends/affiliatelink1.php

    Here is the code used to that page:

    <?php
    header( 'Location: http://affiliatelink1.com' ) ;
    ?>

    Nowadays, I use a much simpler technique that puts all my affiliate links on one php page, i.e. link.php, which resides in the root directory.

    <?php

    $path = array(
    ‘affiliatelink1′ =>  ‘http://affiliatelink1.com’,
    ‘affiliatelink2′ =>  ‘http://affiliatelink1.com’,
    ‘affiliatelink3′ =>  ‘http://affiliatelink1.com’,

    );

    if (array_key_exists($_GET['id'], $path))
    header(‘Location: ‘ .$path[$_GET['id']]);
    ?>

    To make the links work, you must add the following to your .htaccess file:

    RewriteEngine On
    RewriteRule ^go/([/_0-9a-zA-Z-]+)$ link.php?id=$1

    The links are then called using the following linking format:

    http://yourdomain.com/go/affiliatelink1

    Note, you don’t have to create a ‘go’ folder and you may call it anything you like, i.e. recommends, go, links… whatever.

    For example, if youed want to use ‘links’ rather than ‘go’, then change ^go/ to ^links/

    And that’s how to cloak your affiliate links the easy way!


    Related Posts

    1. How to Add Affiliate Links to YouTube Videos using BubblePly
    2. Use Hoplink Shield Links or Your Own Redirects?
    3. My Links are Grey Instead of Blue
    4. Plugin Checks for Broken Links
    5. Clickbank Merchants: How to Hide Your Affiliates’ Links

    Posted / Revised on May 17, 2010 under Affiliate Marketing, Design Tips
    Tags: link cloaking, Make Money

    Rosalind GardnerNeed more info?

    Rosalind Gardner is a Super Affiliate blogger, author, speaker, and Internet marketing consultant. For more info, subscribe to her No-Hype, No-BS, No Spam NPT newsletter and join Affiliate Blogger PRO to get answers to all your affiliate marketing questions. Thanks for visiting!

    Comments

    25 Responses to “How to Cloak Your Affiliate Links the Easy Way”
    1. Earn Online Cash says:
      Monday, May 17, 2010 at 11:23 am

      Thanks for the tips I always wondered how to cloak my affiliate links correctly. Great tips I am gonna implement them into my affiliate marketing campaign.

    2. Alex Newell says:
      Tuesday, May 18, 2010 at 1:00 am

      Not being a techie I’m always grateful for this kind of post. I’m still using my old link cloaker which is a bit quicker than manually creating pages.

      All The Best

      Al

    3. Vicky Lewy says:
      Tuesday, May 18, 2010 at 1:04 am

      Hi Rosalind,

      Thank you for share, however why you don’t use some of WordPress plugins for redirection? For example I use Redirection plugin http://urbangiraffe.com/plugins/redirection/ and it works great. I think it’s more convenient to use a plugin, especially for people who don’t familiar with php.

      Best wishes,
      Vicky

    4. Leo S. says:
      Tuesday, May 18, 2010 at 6:52 am

      May be not so easy as it seems, for some (or many) of us.

      Could be interesting stuff for a more extensive article…

      Anyhow, it keeps us ‘on track’.

      Thank you!

      P.S. Everything alright with you puppy?

    5. bw says:
      Tuesday, May 18, 2010 at 9:11 am

      Many internet companies do not allow affiliates to use redirect pages. Why is that?

    6. Andy Kong says:
      Tuesday, May 18, 2010 at 12:04 pm

      Hi, Ros!
      Thanks for sharing!
      As for me, those affiliate links of mine that I cloak, I make use of the service provided by:
      http://www.tinyurl.com
      What do you think of this method of cloaking affiliate links?

    7. Ken says:
      Tuesday, May 18, 2010 at 14:42 pm

      Hi Rosalind,

      I like the new cloaking method you suggest. The PHP redirect I think works well when you only have a few affiliate links, but having to create a page for each affiliate link is a bit time consuming.

      I also use the Pretty Links WP Plugin. All the links are on one page and simply adding the original affiliate link is needed to create the cloaked link.

      Are you familiar with Pretty Link and what are your thoughts on it?

      Thanks,

      Ken

    8. Jake says:
      Tuesday, May 18, 2010 at 16:27 pm

      Funny, I followed a similar path on my “affiliate redirect journey”. I remember a webmaster clued me in to that “keep it all in 1 file” method, and then when I eventually started coding in PHP, I began implementing that idea.

      One can also take this further if necessary, such as doing any security checks within that 1 master PHP redirect file, choosing 301 vs 302 redirects, email notifications, IP/bot blocking, etc. Yeah, all geeky stuff with possible applications depending on circumstances. But, the basic strategy itself works fine for most people and is a lot “cleaner” than an HTML meta-refresh.

      -Jake

    9. chris says:
      Wednesday, May 19, 2010 at 12:29 pm

      Thks for your tips!You’re great

    10. Marcus says:
      Thursday, May 20, 2010 at 7:58 am

      Is affiliate link cloaking away to protect your links from link theft?

    11. Search Engine says:
      Thursday, May 20, 2010 at 8:28 am

      Hi Rosalind.
      I use a simple html redirect at first but i find the php redirect is much better.
      Or you can use bit.ly , offto.net or similar software to hide your affiliate links.(never use .tk ).

    12. Patch says:
      Thursday, May 20, 2010 at 10:41 am

      I learned how to use a small text file that contains a redirect script and my affiliate link that I name whatever I want and save in my root directory. This cloaks the url but I have to create a text file for each link. Now I am considering purchasing Powerlink Generator because it also allows you to keep track of all the other affiliate information in one place as well (affiliate login, password, commission, etc.) Has anyone used this program?

    13. Glyn Lafferty says:
      Friday, May 21, 2010 at 9:07 am

      Hey Rosalind,

      I use the html version my self but these other ways give far better looking links.

      Great post will be using the php redirects anymore

      Thanks

      Glyn

    14. Rick Faulise says:
      Friday, May 21, 2010 at 13:02 pm

      Thanks for sharing this info! This tip has just saved me a ton of effort and helps organize my affiliate links in one place. I appreciate you taking the time to make this info available.

    15. Steve Cotterell says:
      Friday, May 21, 2010 at 16:20 pm

      Hi Ros

      I love this idea , and will be implementing it straight away! Thanks for the great tip!

      Steve

    16. Lydia says:
      Saturday, May 22, 2010 at 1:12 am

      It is just what I have been looking for :)
      I have tried it and its working great!
      Thanks a lot!

      Lydia

    17. Gerri says:
      Saturday, May 22, 2010 at 4:47 am

      I have been putting up a page for each redirect and had wondered if there was a way of having them all on one page. You have just made my life that much easier. Thank you so much!!

    18. Mick McCrory says:
      Sunday, May 23, 2010 at 0:03 am

      Hi Rosalind, very good information. I’ve been using pretty link for about 4 months now, and it’s great. It’s a WP plugin, and it displays all of my affiliates on one page and tracks every click and unique click. I love it.

    19. Christian Entrepreneur says:
      Tuesday, May 25, 2010 at 6:48 am

      Thanks. I was looking for a way to cloak my links from for affiliate products. This is quick and easy. All the best, Buddy

    20. The diet solution program review says:
      Tuesday, May 25, 2010 at 9:22 am

      I’ve never cloaked my affiliate links before, is it really necessary?
      How much do you benefit from it?

    21. Ryan Mill says:
      Wednesday, May 26, 2010 at 5:40 am

      Good Tips.

    22. Simon Croft says:
      Thursday, May 27, 2010 at 17:58 pm

      Hey Ros,

      Never did understand the whole affiliate cloaking stuff. Looks so easy when shown like that. Will have to give it a try.

      Thanks for sharing

      Simon

    23. Jonathan says:
      Friday, May 28, 2010 at 5:25 am

      Why not just use the GoCodes plugin for WordPress? Works like a charm, and very easy.

    24. Sheralyn says:
      Saturday, May 29, 2010 at 2:31 am

      Cool… Thanks for sharing…

    25. chris says:
      Sunday, August 22, 2010 at 12:49 pm

      Thanx for sharing, im a complete newbie to affiliate marketing i follow some of what your saying, i will have to look more deeply into it, thank you

    Have Your Say

    Click here to cancel reply.



    Follow me on Twitter Subscribe to Rosalind Gardner's Internet Marketing News Follow me on Facebook

    Popular Articles

    • 11 Ways to Make Money Online
    • 6 Ways to Lower Your Bounce Rate
    • 8 Recession-Proof Product & Service Ideas
    • CMS, Blogs, Websites & Website Builders: What's the Difference?
    • Cut Your Writing Time in Half
    • Essential Reading for Entrepeneurs
    • How to Live & Work Anywhere
    • How to Overcome Writer's Block
    • How to Sell WITHOUT Selling
    • NOT for Affiliate Marketers
    • Ros' BIG List of Marketing Tools

      Recommended

      • Autoresponders
      • Blogger Training
      • Content Suppliers
      • Site Hosting Services
      • Website Builders
      • Wordpress Themes

    Copyright © NetProfitsToday.com 2003 - 2010 · All Rights Reserved
    · Terms of Use · About · Books · Services · Contact

    This blog is powered by StudioPress themes for Wordpress and Aweber