How can I protect a folder using .htaccess? I want the folder /files/myfiles
to only be accessed by the server, not by a user? How can I do that?
views:
124answers:
3
+2
A:
Add the .htaccess
file to /files/myfiles
folder with the following in it:
deny from all
Internally when your scripts look for files they aren't going through Apache, only when someone requests it on port 80. So this will deny any listing and permissions to them.
Garrett
2009-08-16 22:36:30
Well, yeah but I have some...files such as images..which i nuse them on the UI, so i need access for the server..
Uffo
2009-08-16 22:39:25
Should have been more clear in your question then. :)
Garrett
2009-08-17 00:10:08
+1
A:
I would add the following to an .htaccess:
order deny,allow
deny from all
allow from localhost
allow from 127.0.0.1 // incase your loopback isn't configured correctly
allow from 192.168 // incase software isn't using your loopback correctly
Hope that helps!
Al
2009-08-16 22:42:16