I'm trying to make it so that the outside world can't access a specific section of my website. What I did was:

<Directory /Library/WebServer/.../secrets/>
     Order deny,allow
     Deny from all
     Allow from 10.0.1.18
</Directory>

(10.0.1.18 is my computer's internal IP) That seemed to work for the root folder, but not for subfolders. So I tried secrets/* in the directory block, but that disabled everything. Anyone could access the secrets folder.

How would I make the directory block apply to subfolders?

link|improve this question
feedback

1 Answer

According to this:

<Directory> and </Directory> are used to enclose a group of directives that will apply only to the named directory, sub-directories of that directory, and the files within the respective directories.

So if you omit the trailing slash then this should work:

<Directory /Library/WebServer/.../secrets>

secrets/* means subdirectories and files below the secrets directory, not the directory itself.

link|improve this answer
Well, that worked. But it also locked me out. I still have the 10.0.1.18 ip address... Could it be that the secrets folder is a web app? (phpMyAdmin) – Cole Oct 13 '11 at 23:28
Can you get to the phpMyAdmin login screen or can't you even see that? – paulmorriss Oct 14 '11 at 11:46
No, I can't see that. I just get the "access forbidden" page. – Cole Oct 14 '11 at 21:42
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.