title: Is there a way to force apache to return 404 instead of 403?
body: <p>Is there a way how I can configure the Apache web server to return a 404 (not found) error code instead of 403 (forbidden) for some specific directories which I want to disallow to be accessed?</p>
  
  <p>I found some solutions suggesting the use of mod_rewrite, like e.g.</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^.*$ /404 [L]
  </code></pre>
  
  <p>As the purpose of sending 404 instead of 403 is to obfuscate the directory structure, this solution is too revealing, because it redirects to some different location which makes it obvious that the directory originally accessed does in fact exist.</p>