title: Adding noindex header to php redirect file
body: <p>I have a simple php redirect script (link.php) that I use to keep track of our affiliate links. (Example: <a href="http://www.example.net/link.php?id=1" rel="noreferrer">http://www.example.net/link.php?id=1</a> will bring you to <a href="http://www.product1url.com" rel="noreferrer">http://www.product1url.com</a>)</p>
  
  <p>I've noticed that Google is indexing <a href="http://www.example.net/link.php?id=1" rel="noreferrer">http://www.example.net/link.php?id=1</a>. I have link.php set to noindex in Robots.txt but that's not stopping the indexing. So I want to add a "noindex", "nofollow" header to each URL itself.</p>
  
  <p>Here's the script I have:</p>
  
  <pre><code>&lt;?php
  
      $path = array(
  
      '1' =&gt; 'http://www.producturl1.com',
      '2' =&gt; 'http://www.producturl2.com',
      );
  
      if (array_key_exists($_GET['id'], $path))
       header('Location: ' . $path[$_GET['id']]);
  
   ?&gt;
  </code></pre>
  
  <p>How do I modify this to include: "X-Robots-Tag: noindex, nofollow"? Is this possible?</p>