title: Page is not returning 404 while directing to custom 404 error page
body: <p>I have created a <strong>custom 404 page named file-not-found.php</strong> in my website. And I changed the <strong>.htaccess</strong> file to,</p>
  
  <pre><code>ErrorDocument 404 /file-not-found.php
  </code></pre>
  
  <p>This is working perfectly okay and I also fetched a non existing url with Google webmaster tools and it displays correct 404 error. </p>
  
  <p>I am deleting my articles after a specific time period.So what I decided to do was to <strong>redirect users for file-not-found.php with 404 status code</strong> if they looking for a removed content.So in the article page I wrote the following code</p>
  
  <pre><code>&lt;?php 
  if(mysql_num_rows($sql)!=0){
  //display content
  }else{
  //redirect to custom error page
  header('HTTP/1.0 404 Not Found');
  header('location:file-not-found.php');
  exit();
  }
  ?&gt;
  </code></pre>
  
  <p>So now if the user request a removed content it redirects to the custom 404 page.</p>
  
  <p>But the problem is if I fetch for a removed content link from Google webmaster tools it's returning status 200 rather than 404.</p>
  
  <p>So Where would be the problem please help me to correct this issue.Thanks all.</p>