Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How could I give different access to sub-directories?

The first problem is: I must let the programmers modify the htaccess files, but not the access control.

I have access only to htaccess directives for once, not to the httpd.conf of Apache. And here are my folders:

~/beta/ -> group betatesters developers
~/dev/ -> group developers

I would like to have only one .htaccess located in the root directory (developers don't have access there).



AuthType Basic
AuthName "Password Required"
AuthUserFile /home123/user321/htpasswd
AuthGroupFile /home123/user321/htgroup
<FilesMatch "beta">
    Require group betatesters developers

<FilesMatch "dev">
    Require group developers

Any idea?

share|improve this question

You can set in the Apache conf what parameters are fair game to be changed in a .htaccess file.

In your specific example, you don't want the AuthConfig settings to be overidable. You can do that either by not listing AuthConfig with the AllowOveride directive. eg.

<Directory foo>
   AllowOveride Indexes <...>

Or explicitly declaring that AuthConfig is not modifiable.

<Directory foo>
   AllowOveride -AuthConfig <other options here>
share|improve this answer
it's not that I don't want Authconfig to be overidable or not, it's that I want a different one for each. And in a perfect world it would not be in .htacces in each directory itself – chriscatfr Sep 14 '11 at 16:01

after you stated you DON'T have access to httpd.conf, Joshua Hoblitt answer only applies partially.

if it is possible for you to use another directory structure like


you could adapt Joshua's solution.

share|improve this answer
I don't understand how I could have the equivalent of a <Directory> for each... directory. Since my goal is to have different rules for each one. – chriscatfr Sep 14 '11 at 15:26
sorry i missunderstood – Mose Sep 14 '11 at 20:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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