title: How to use Errordocument 404 with 301 in header?
body: <p>I have a dynamic content website and I want to redirect all non existed pages to index page but with the header showing 301 permanent redirect and not the 404 error.</p>
  
  <p>I know that I can redirect with .htaccess</p>
  
  <pre><code>Errordocument 404 /index.php
  </code></pre>
  
  <p>But this will have the 404 status in the header, and I'd rather the header to show a 301 redirect.</p>
  
  <p>Is this possible?</p>