homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Google / Google SEO News and Discussion
Forum Library, Charter, Moderators: Robert Charlton & aakk9999 & brotherhood of lan & goodroi

Google SEO News and Discussion Forum

Masking Affiliate Links

 6:01 am on Feb 12, 2007 (gmt 0)

If a site has affiliate links and is suffering in the serps ***maybe*** because of this then ..

A) Should you mask them or redirect them in some way?

B) Is yes then what is the best way - staying within webmaster guidelines of course?



 10:07 am on Feb 12, 2007 (gmt 0)

I used until now the following:

1. I create a file "aff_store.html"
2. add to this file meta noindex, nofollow
3. Link to www.example.com/aff_store.html
4. add to this link a nofollow
5. set up a 301 in htaccess from www.example.com/aff_store.html to the actual aff link

I do not know if this is full proof...


 9:51 pm on Feb 12, 2007 (gmt 0)

> Should you mask them or redirect them in some way?

Sure. Just run a redirect off your own site.

Run the url through a redirector parked in your cgi-bin - and then mark cgi-bin off limits in your robots.txt.

The real benefit though, is that the redirector script can also count the urls for you as people click them. Thats mega data to have...

Here is a simple one in perl:

# code a url with [ThisProgramURL...]

$FORM{'url'} = "http://www.yourdomain.com/";
$logs= "/mypath/mydomain/mylogdirectory/cgi-bin/";
$b= time;

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
if (length($buffer) < 5) {
$buffer = $ENV{QUERY_STRING};

if ($buffer =~ /(.*)\&url\=http(.*)/i) {
$FORM{'url'}="http" . $2;

@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$FORM{$name} = $value;
if ($buffer =~ /(.*)\&url\=http(.*)/i) {
$FORM{'url'}="http" . $2;

($tsec,$tmin,$thour,$tmday,$tmon,$tyear,$twday,$tyday) = localtime(time);
$tyear =$tyear+1900 if $tyear <1900;
$tmday = "0" . $tmday if $tmday <10;
$tmon = "0" . $tmon if $tmon <10;

#write the click to a log file:


print LOG qq"$ENV{'REMOTE_ADDR'}\$FORM{'url'}\$b\$FORM{'note'}\n";

print "Location: $FORM{'url'}\n\n\n";



 9:53 pm on Feb 12, 2007 (gmt 0)

Since making this post I have found quite a few different ways suggested - Thanks for this one it looks as good as any of them.

I guess you could also use robots.txt too keep the google away from any page that has your affiliate code / 301 redirect.

There was also a php based click tracking solution I found that actaully has a legit function other than to mask the link.

So making the change is not so difficult but how will Google and the other SE's look at it? Does anyone have an opinion even?


 10:17 pm on Feb 12, 2007 (gmt 0)

Are you talking an intrinsically useful site with affiliate links, or a "thin affiliate" site?

Masking affiliate links isn't necessary with the former and isn't likely to disguise the latter.


 10:21 pm on Feb 12, 2007 (gmt 0)

intrinsically useful site with affiliate links

Even so... it's still nice to mask. [ the reasons are a plenty - no need to explain ].


 11:08 pm on Feb 12, 2007 (gmt 0)

The sites are usefull and not at all "thin" fully functional and long established 4 years and longer - Membership in excess of 70k built over time. We are just getting pushed around in the serps so masking affiliate links is one of the factors we are looking to address to help us take some ground back.


 12:01 am on Feb 13, 2007 (gmt 0)

Nice script Brett, I added that to my collection.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Google / Google SEO News and Discussion
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved