views:

25

answers:

2

Hi, I have a directory which contains a htaccess file:

AuthType Basic
AuthName "Go away"
AuthUserFile /home/daniel/.htpasswds/directory1/.htpasswd
Require valid-user

I have a subdirectory within that folder that I wish to use a different set of usernames/passwords for. How do I negate the effects of the first htaccess so I can use the auth?

Thanks

A: 

Just put another .htaccess in the subfolder and override the needed settings in there.

Jari
Hi,I tried that, but then it asks me for both sets of usernames and passwords :S
Daniel Smith
It asks subdirectory specific username and password when you are accessing content inside that directory and parent directory specific credentials when you access content from there. So, if you try to access content from both places, it will ask you both sets, but accessing content only from one of the directories is possible with only one username and password.I thought that was what you were asking for?
Jari
A: 

To use another .htaccess is disabled by default. So you first have to set "AllowOverride AuthConfig" in the directory directive of your apache config file.

senglert