.htaccess authorization requiring username/password for every resource

Posted by webworm on Super User See other posts from Super User or by webworm
Published on 2010-03-30T13:54:39Z Indexed on 2010/03/30 14:03 UTC
Read the original article Hit count: 449

Filed under:
|
|

I am using Apache2 on Ubuntu and I have having some "weird" user authorization issues. I am using .htaccess to control access to my directories. I have many users and have grouped them into user groups which are defined in a "group" file. I then use .htaccess within each directory to define which users have access to the directory and which do not. Here is an example .htaccess file.

AuthUserFile /var/local/.htpasswd
AuthGroupFile /var/local/groups
AuthName "Username and Password Required"
AuthType Basic

require group design admin

Everything is working with one exception. I added a new user to one of my groups and though they can gain access to the directory they are prompted for a username and password for every resource (i.e. image, CSS). After a while I can just keep selecting "cancel" and I will get a page with just html with no images or CSS. I would think the browser would just cache the username/password. It seems to be working well for other users. Any thoughts?

© Super User or respective owner

.htaccess authorization requiring username/password for every resource

Posted by webworm on Server Fault See other posts from Server Fault or by webworm
Published on 2010-03-30T15:10:01Z Indexed on 2010/03/30 15:13 UTC
Read the original article Hit count: 449

Filed under:
|

I am using Apache2 on Ubuntu and I have having some "weird" user authorization issues. I am using .htaccess to control access to my directories. I have many users and have grouped them into user groups which are defined in a "group" file. I then use .htaccess within each directory to define which users have access to the directory and which do not. Here is an example .htaccess file.

AuthUserFile /var/local/.htpasswd
AuthGroupFile /var/local/groups
AuthName "Username and Password Required"
AuthType Basic

require group design admin

Everything is working with one exception. I added a new user to one of my groups and though they can gain access to the directory they are prompted for a username and password for every resource (i.e. image, CSS). After a while I can just keep selecting "cancel" and I will get a page with just html with no images or CSS. I would think the browser would just cache the username/password. It seems to be working well for other users. Any thoughts?

© Server Fault or respective owner

Related posts about apache2

Related posts about htaccess