Adding nofollow to PHP redirect links

6 replies
Hi Warriors,

Need some help here with PHP redirect link.

I've been using PHP to redirect my affiliate link.

<?php header ('Location: myaffiliatelink');?>

Right now, I am trying to add nofollow code to my PHP redirect affiliate link but unaware of how to do it.

Does anybody know how to add a nofollow code to PHP redirect affiliate link?

Thanks
#adding #links #nofollow #php #redirect
  • Profile picture of the author Bruce Hearder
    You cannot add NOFOLLOW to a PHP redirect!

    NOFOLLOW is only associated with anchor tags <a> in HTML

    If you want to stop search engines giving value to your affiliate links, then make the link a 302 links. This means its temporary.

    So something like this will work :

    <?php header('Location: http://some-affiliate-link.com',302); ?>

    Hope this helps

    Bruce
    {{ DiscussionBoard.errors[1798735].message }}
  • Profile picture of the author imarketstuff
    super star.. just do the following:

    Code:
    <a href="http://www.domain.com/php.redirect.script" rel="nofollow">click me</a>
    using your relevant domain/script/anchor info of course
    Signature
    I MARKET STUFF

    {{ DiscussionBoard.errors[1799184].message }}
  • Profile picture of the author mywebwork
    Bruce, once again I see you've come to the aid of a fellow Warrior and didn't get the thanks that you deserve. So let me give you one, for this and for all of the other useful tips you constantly provide.

    Bill
    {{ DiscussionBoard.errors[1799300].message }}
    • Profile picture of the author super star
      Thanks Bruce & imarketstuff

      This really helps.

      You have save me from spending hours searching for the solution online...
      {{ DiscussionBoard.errors[1799370].message }}
    • Profile picture of the author Bruce Hearder
      Originally Posted by mywebwork View Post

      Bruce, once again I see you've come to the aid of a fellow Warrior and didn't get the thanks that you deserve. So let me give you one, for this and for all of the other useful tips you constantly provide.
      Bill
      Thanks Bill... Much appreciated

      Bruce
      {{ DiscussionBoard.errors[1819900].message }}
  • Profile picture of the author xiaophil
    Originally Posted by super star View Post

    Does anybody know how to add a nofollow code to PHP redirect affiliate link?
    Yes.

    Code:
    header("X-Robots-Tag: noindex, nofollow", true);
    Cheers,

    Phil
    {{ DiscussionBoard.errors[1820313].message }}

Trending Topics