Make money blogging in South Africa


Masking affiliate links

December 22nd, 2006 · 5 Comments

Ever wondered how, when you hover over an affiliate link on someone’s site, it shows something like this:

http://www.problogging.co.za/recommends/offerforge

I too wondered that. It really is an simple, yet very smart way of hiding those ugly affiliate links, as well as tracking your affiliate clicks. Want you know how its done? Sure you do…

Firstly, set up a folder at your webhost off your home directory. I have setup a /recommends folder over here at Problogging. Then inside that folder you create another folder for every affiliate link that you want to mask. So for Offerforge (aff) I setup another folder - /recommends/offerforge. In this folder create a file called index.php. Then add these 3 lines of code to that page as follows.


<?php
header('location:http://www.example.com?affiliatelinkID=12345')
?>

Replace the URL with your affiliate link (remember to leave the location: part) and off you go! Now you are able to track how many clicks you getting for your affiliate programs, as well as your links now look super clean. There are debates on whether you should or should not mask your links, but I feel its perfectly legit if you not trying to trick your readers into clicking these links.

Until next time
Jason

Tags: affiliate marketing · blogging for money

5 responses so far ↓

  • Kian Ann // Dec 24, 2006 at 3:21 am

    Thanks! Another way is to amend the .htaccess file for Apache web servers… but I think your way is the ’safer’ way - it does pay to screw up the .htaccess file! :P

  • JBagley // Dec 24, 2006 at 4:27 pm

    Editing your .httaccess file sometimes is a little tricky, especially for beginners, so as you say Kian Ann, this way is safer!

  • Andy Beard // Jan 3, 2007 at 2:35 am

    You will find most people are using one of many specialist tools such as Adtrackz for creating redirects.

    Often it is necessary to mask the link at the other end as well, so that in the browser the URL is sticky.

  • Jan the Fish // Aug 20, 2007 at 9:24 pm

    If anyone wants to check the destination link, you will not be secured anyway :) . Even if you used page with frame…

    2 days ago I received submission into my directory… It was so-called web hosting… I was curious why the bottom line of my browser didn’t show me data loading from that domain. Instead, it was showing other domain’s name… Just few seconds later my eyes spotted same URL inside of the browser’s URL box no matter where I was clicking on that site.

    Of course I rejected such submission… It was frame.

    I just would like to say that sometimes you should sell something what’s your own product rather than being an affiliate…

  • Bookmarks Explosion for Boxing Day 2006! - Blogopreneur.com // Oct 2, 2009 at 11:17 am

    […] you are doing some affiliate marketing, Jason is here to share with you how to mask your affiliate links. No prior technical knowledge required, and no nasty .htaccess files to mess […]

Leave a Comment