title: .htaccess to restrict access from all except one specific url
body: <p>I'm using a membership script to allow access to private files by a group of people. The problem is anyone who knows the link to the files can easily bypass the membership script and have direct access to the files. My goal is to prevent direct URL access through <code>http://domain.com/folder1/folder2/index.php</code> and to only accept access from <code>http://domain.com/folder1/file_with_link_to_index.php</code>. The membership script is useless unless I can prevent people typing in the url to the file locations.</p>
  
  <p>I'm having a hard time even beginning to understand Apache but what I was attempting to do was to use "Deny All" and then "Allow from <code>http://folder1/file_with_link_to_index.php</code>." so that access to the files could only be access through the "file_with_link~" only. It didn't work. I was still able to paste the url to the files into the browser and access the directory.</p>
  
  <p>I found similar questions on StackO but not enough experience to understand and actually take the little pieces that were similar to my problem and actually use them. It's probably something simple but I'm so frustrated with trying to figure this out that I can't see it.</p>
  
  <p>Here's a quick example of what I was trying to use:</p>
  
  <h1>deny all except those indicated here</h1>
  
  <pre><code>&lt;Limit GET POST PUT&gt;
   order deny,allow
   deny from all
   allow from 12.345.67.890
   allow from http://domain.com/fold1/LINKING_FILE/program_index.php
  &lt;/Limit&gt;
  </code></pre>
  
  <p>I'm pretty sure I'm failing on the way the domain is supposed to be written and maybe that's why it's not working?</p>