title: HTTP_REFERER and Location redirect
body: <p>I have been looking for a while here and can't find an answer to my specific question.</p>
  
  <p>In 100's of places on my site I am redirecting to an error page via a header-location redirect. </p>
  
  <pre><code>header("Location: /error.php");
  </code></pre>
  
  <p>What I want to do is capture and log the HTTP_REFERER on the error.php page, but for some reason it isn't set. I have seen explanations of why it isn't set with Meta-refresh, but the location header is a 302, so it should be set right? Any thoughts?</p>
  
  <p>Please note: I know the HTTP_REFERER is unreliable, and I know that I can pass the information separately. Neither of which matter in my scenario (unless I want to change all the places where the redirect is called).</p>