title: .htaccess - Deny access to folder but allow access to file via index.php
body: <p>I'm having a problem with .htaccess and PHP-files in a sub folder. What I'm trying to achieve is to prevent anyone from being able to access any file in my sub folder - BUT I want my index.php to be able to access those files.</p>
  
  <pre><code>DOCROOT/subfolder -&gt; www.somewebsite.com/subfolder/somefile.php
  -&gt; Access Denied
  </code></pre>
  
  <p>BUT</p>
  
  <pre><code>[index.php]
  &lt;form action="/subfolder/somefile.php"&gt;
  ...
  &lt;/form&gt;
  -&gt; Success!
  </code></pre>
  
  <p>I would love to solve this by just using .htaccess. I tried <code>deny from all</code>and also some <code>RewriteRule</code>s but those Rules also kill any request from index.php. 
  I tried</p>
  
  <pre class="lang-html prettyprint-override"><code>Order deny,allow
  Deny from all
  Allow from 127.0.0.1
  Allow from somewebsite.com
  Satisfy Any
  </code></pre>
  
  
  
  <p>but the request from index.php is being denied. Can anyone help, please?</p>