title: If $_SERVER['HTTP_REFERER'] was 404 Page Not Found
body: <p>In PHP is there any way to catch a 404 not found?</p>
  
  <p>If a user ends up on a 404, I want them to be redirected to a known page, but to display something different if it is due to a 404 error.</p>
  
  <p>Something like</p>
  
  <pre><code>if($_SERVER['HTTP_REFERER'] == 404){
      echo("You've been redirected!");
  }
  </code></pre>
  
  <p>Thanks in advance</p>