title: Prevent directory access and show forbidden error
body: <p>In PHP and apache web server to prevent from listing and browser showing as i know we can use <code>.htaccess</code> <br /><br />
  <code>Deny from all</code> <br /><br />
  or using <code>index.html</code> file</p>
  
  <pre><code>&lt;html&gt;
  &lt;title&gt;403 Forbidden&lt;/title&gt;
  &lt;body&gt;
  Directory access forbidden!
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>which is better then both approaches? in security and speed access to show the error or there is another approach better then both approaches</p>