title: Redirect to 404 page programmatically using asp.net MVC
body: <p>I have created a Asp.net MVC application. Now required 404 handling. </p>
  
  <p>Have updated global.asax and display 404 page based on status code. Also added customErrors property in web.config. Its working fine.</p>
  
  <p>Now I would like to redirect to 404 programmatically when any thing not match with our requirement.</p>
  
  <p>i.e. </p>
  
  <pre><code>if(!valid) 
  {
      return RedirectToAction("Index", "Page404");
  }
  </code></pre>
  
  <p>It's working fine but there are 2 status one is 301 &amp; then 404. So how can I prevent 301? I just need 404.</p>
  
  <p>How can I achieve this?</p>