Click to See Complete Forum and Search --> : Unix/?Apache? permissions


thepeccavi
11-10-2008, 08:08 PM
Hi,

I would like to create a folder (well, several folders), which cannot be seen via HTTP, but can be accessed by PHP. This is to facilitate secure file downloads.

Can this be done in a standard shared-server LAMP environment with just CHMOD, or can it be done with .htaccess? Or maybe neither!

At the moment, I have simply got a folder that is outside the htdocs area, but I am expanding the site to use separated areas and it would be much neater if I could have the private folder inside htdocs, but protected by Unix/Apache.

In addition, could the folder creation process be automated in PHP? This would be the holy grail for me!!

Thanks in advance,

Isaac

thepeccavi
11-11-2008, 06:59 AM
I think I have solved the problem:

.htaccess
-------
Order deny, allow
Deny from all
Allow from localhost
Allow from 127.0.0.1
Allow from my.host.com
-----------

Isaac

jazz_snob
12-03-2008, 02:23 AM
Looks right. Usually I can get by with just "deny from all" in the .htaccess file.

thepeccavi
12-03-2008, 12:27 PM
It seems that that works for me too... This is all now working.