Been doing some research on this lately and have decided the best way to handle my affiliate links is to create a php script which I can call and then redirect to the actual affiliate link. It was said the great Matt Cutts even recommended this.
So, few questions...
- Would it be correct to use something along the lines of www.mysite.com/script.php?id=product1 which then redirects to the actual url?
- Would I use rel=nofollow on the www.mysite.com/script.php?id=product1 in my pages?
- in robots.txt would I also exclude script.php even with the nofollow or just exclude it without the nofollow?
Going a step further into the thought process what kind of security steps should be taken so the script cannot be manipulated? Simple thinking tells me if I use id=whatever that the script could not be manipulated as anything value that does not exist I could just send to the index page or something - correct?
Anyone care to share a good example I can run with or flat out use?
Tedster... you seem to be on most of the posts regarding the affiliate redirects I read... please chime in if you have the time.
1. Yes with the script.php handling the redirect 2. No need to, instead use js hooking the click handler with a unique identifier perhaps to avoid automatic submissions. 3. You won't have to if you use js because there would be no visible/hard link.
Thanks for the reply, but I want to stay away from using js and only use php.
I'm still doing research on this and the one question that stands out to me is this :
www.mysite.com/script.php?id=product1 ... this seems as though, Google for example, might see this as cloaking as I am showing the above link, however, directing the user to another (affiliate link)... thoughts on this? As a webmaster I can see many reasons why the above would be beneficial to me (easily change sitewide links on one page, etc, etc), however, does Google see it that way? Some would say the fact I am questioning it means I should be leary of it.
I also have seen sites which use the same format above, however, their id value in this case IS the url they want to redirect to... in other words they are not hiding anything (which Google likes)...