.htaccess authentication for 2 servers

Posted on 2006-06-04
Medium Priority
Last Modified: 2010-03-04
Hello there,
    I was wondering if it was possible to join .htaccess auth on 2 servers. Such as, if someone had gone to server A, entered their log/pass, could they go to a .htaccess protected directory on server B without needing to re-enter (the same log/pass) again for that server.


Question by:undinism
LVL 57

Expert Comment

ID: 16829859
Are these physically two unique server or are they the same sever just different virtual hosts?

Author Comment

ID: 16829877
2 physically unique servers. Both are located on the same LAN that is connected to the net.
LVL 15

Expert Comment

ID: 16834262
I don't know of a way that they wouldn't have to re-enter the informaton on server 2; however, if the second server was entirely script driven, it isn't hard to pass the user id to the second server.  You could do so with a small script like:

use CGI qw(:standard);
$userid = $ENV{'REMOTE_USER'};
LVL 15

Expert Comment

ID: 16834279
Let me clarify my statements.  I don't know of a way that they wouldn't have to re-enter the information using strictly .htaccess commands;  if the second server was completely script driven, though, you could pass the userid information from the first server to the second one using a script like the one that I mentioned above.
LVL 10

Accepted Solution

sleep_furiously earned 500 total points
ID: 16842997
You can span authentication across different servers by using Digest authentication.


See in particular the AuthDigestDomain directive.


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question