Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I'm setting up a basic test environment to test drive multiple sites I co-maintain with a colleague.

What I am trying to achieve is to password protect the entire domain with basic auth. This is working, but the problem is that for every subomain you need to reauth yourself. Which, to say the least, is pretty annoying since there are at least 30 subdomains in use at the moment.

Is it possible to transfer the basic auth session across multiple subdomains?

I know I can try to rewrite it all to use a different kind of auth but basic auth is a lot easier to set up.

I am using apache and these are the rules I am using for basic auth:

AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /svn/authz
Require valid-user
share|improve this question
up vote 1 down vote accepted

These answers provide a way to share authentification across multiple subdomains: Apache .htaccess trick to authenticate only once for all subdomains? and

However the subdomains have to be listed explicitely, it won't work with wildcards (which is frustrating because I have a domain with 350+ subdomains I would like to share authentification for).

share|improve this answer
Yeah, the amount of subdomains is expected to grow to at least 100 as well, but the solution does work. Even though in the end we decided to go for ip based authentication (192.168.*.*) always gets access and some dedicated IP's, for the rest basic auth that needs you to resign in every subdomain.. – gnur May 31 '11 at 9:28

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.