title: Protect php files from direct access
body: <p>This is what the map of my website looks like:</p>
  
  <pre><code>root:
       -index.php
       -\actions\ (various php files inside and a .htaccess)
       - \includes\ (various php files inside and a .htaccess)
       - .htaccess
  </code></pre>
  
  <p>I know that if I use "deny from all" in actions and includes directories, the files in them will be secured from direct access.</p>
  
  <p>Now, my actions folder has many php files that are called by <code>index.php</code> (forms).
  I have "deny from all" in <code>.htaccess</code> inside <code>\actions</code>, but then I have the forbiden access to that files.</p>
  
  <p>So, how can I protect the files from direct url access but have the exception that can be called from <code>index.php</code>?</p>