Is it possible to send a header for the nofollow tag in PHP I am using the location header to redirect traffic but do not want Google to follow the link. It's all above board I am writing a click tracking script. Any ideas
check the referrer. If it is google redirect it to another folder. Block the robot using robots.txt or use mod_rewrite
By the time you get to sending that location header, it's really too late to be thinking about reacting differently to Googlebot. Best thing to do is ensure Googlebot doesn't even attempt to follow the link, otherwise you're stuck checking the IP &or HTTP_REFERER & going from there, which is actually work that the server wouldn't have to do if proper preperations were done to begin with. You can send an X-Robots-Tag header if you just want to prevent indexing. header('X-Robots-Tag: noindex'); Code (markup): In case you're wondering, using nofollow as the value for a X-Robots-Tag header will apply to links in the page being returned, not the page itself.
Thanks joebert, that's put me on the right track. Have given you some green. I have decided to go the route of hard coding the nofollow into the links as the X-Robots-Tag will not give the desired effect. To also note that detecting googlebot to feed it a different set of instructions is against Googles term, not that that was my intention. My goal was to be able to set advertisers/affiliate links as nofollow, the only proper way to do this is to add the rel="nofollow" tag into the link. I am doing this so I can comply with googles Paid links "law". thanks too commandos and chandubhai also for your input.