title: PHP referer url and redirect
body: <p>I can't seem to work out why the below sends ALL traffic to the page-not-found page, even if referred by Paypal. Any ideas?</p>
  
  <pre><code>$refererUrl = $_SERVER['HTTP_REFERER'];
  $Exploded = explode("/",$refererUrl);
  $urlToCheck = $Exploded[3];
  $findURL = strpos($urlToCheck,'paypal.com');
  if($findURL === false){
      header('location:/page-not-found');
  } else  {
  /* Do something if page referred to by Paypal */
  }
  </code></pre>