Adding nofollow to PHP redirect links

by 6 replies
11
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
#programming #adding #links #nofollow #php #redirect
  • 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
    • [ 1 ] Thanks
  • 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
  • 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
    • [2] replies
    • Thanks Bruce & imarketstuff

      This really helps.

      You have save me from spending hours searching for the solution online...
    • Thanks Bill... Much appreciated

      Bruce
  • Yes.

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

    Phil

Next Topics on Trending Feed