PHP nofollow's

Discussion in 'PHP' started by newsniche, Nov 16, 2007.

  1. #1
    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
     
    newsniche, Nov 16, 2007 IP
  2. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #2
    block it using robot.txt
     
    commandos, Nov 16, 2007 IP
  3. chandubhai

    chandubhai Banned

    Messages:
    556
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #3
    check the referrer. If it is google redirect it to another folder. Block the robot using robots.txt or use mod_rewrite
     
    chandubhai, Nov 16, 2007 IP
  4. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #4
    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. :D

    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.
     
    joebert, Nov 16, 2007 IP
    newsniche likes this.
  5. newsniche

    newsniche Peon

    Messages:
    1,017
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #5
    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.
     
    newsniche, Nov 16, 2007 IP