title: Deny Access to directories from unauthorized users
body: <p>I am not being paid for this and I would like to know the quickest way to do the following. A former client has a page which only members can access. This page links to a number of galleries which he only wants members to access. The galleries are not protected by any kind of authentication.</p>
  
  <p>What I assume is the quickest way to do this is to create a .htaccess file which only allow people to view the site when the come from a certain referrer. Would this work?</p>
  
  <p>My current thinking is that I could use a php script to deploy a .htaccess file into each of the gallery directories. (There are around a 100 at the moment.)</p>
  
  <p>I found this link which might be what I am after but to be honest I really don't get it. Is my thinking sound? Could someone either link me to a tutorial that does this or show me how it is done.</p>
  
  <p><a href="http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/#sec7" rel="nofollow noreferrer">http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/#sec7</a></p>
  
  <p>As always, a massive thank you for any help.</p>
  
  <p>Jason</p>