title: htaccess to deny access to files except when accessed from a specific subfolder on server
body: <p>I have a folder in the root of my webshare that holds semi confidential pdf documents.  I want anyone accessing that folder or its files to get a permissions error.   Thats easy to setup and I have it working with</p>
  
  <pre><code>&lt;FilesMatch "\.pdf$"&gt;
   Order Allow,Deny
   Deny from all
  &lt;/FilesMatch&gt;
  </code></pre>
  
  <p>However I want a subfolder on the server that contains PHP scripts to be able to link to these PDF files.  Note; I don't want php to be able to read the files internally within the server, but for http requests directly linking these restricted files to suddenly be possible.</p>
  
  <p>I read that htaccess files in child folders can overrule rules higher up a folder path set in a root folder htaccess file.  To that end I have setup an htaccess file in the specific subfolder with the php scripts (using allow from all) but it doesnt seem to work.</p>