Log in

View Full Version : Are multiple .htpasswd files possible?



gresh
10-18-2009, 10:52 PM
Just beginning to explore the wonders of .htaccess ...

I have .htaccess protecting a restricted folder on my site, with the .htpasswd file residing one level above the site root. It works great.

I'm trying to also password protect a single file in a different subdirectory on the same site.

I've tried pointing the .htaccess file for that subdirectory to a second .htpasswd file, renamed to .htpassw2 which was placed alongside the other .htpasswd file.

Result: 401 error

So I tried leaving the file name (.htpasswd) intact and placing the second .htpasswd file inside a dedicated subdirectory (also one level above the site root) and pointing to it by appending the subdir name to the AuthUserFile string in the .htaccess file.

Result: 401 error

I figured it was time to look for some help, and I can't seem to find a previous thread that deals with my question -- apologies if I missed something.

For the curious, the cache was cleared repeatedly during testing.

Help? Anybody?

Thanks for being here

gresh
10-18-2009, 11:58 PM
Ummm ... never mind. I just discovered the difference between 'user' and 'auth-user' ...

Sorry to trouble you