Forum Moderators: phranque
I use htaccess on a very limited basis now, but what I need to do with a current project is to FORBID access to a bunch of specific directories located within the root of the site. I don't want these directories password-protected, I need them to be completely hidden from URL access as they contain sensitive PHP functions for this particular project.
You know, sometimes you go to a url and you get the message "Forbidden Directory" or some such message. That's what I need, but don't know the htaccess syntax to use for these directories.
Can someone please assist me?
Thanks to all in advance!
Neophyte
Jim
Thanks for your reply - thanks also to phranque for moving this post to a more appropriate forum.
Jim... I suppose I could use FilesMatch with the .php extension but I was kind of hoping to lock out entire folders of files at one go. Then I saw the <Directory /> link. Could I not forbid entry into any named directory by doing something like the below?
<Directory />
*this directory*,*that directory*,*some other directory*
Deny from All
</Directory>
I'm sure my syntax isn't correct, but if this would work, it would seem like the path of least resistance.
Appreciate your continued input,
Neophyte
Otherwise, use <Files *> in .htaccess files within the directories you want forbidden to deny access to all files within those directories.
Jim