Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with .htaccess and limiting subdomain access

Status
Not open for further replies.

Microbe

Programmer
Oct 16, 2000
607
AU
Hey folks,

Hoping someone here may be able to help - have searched all over but no joy.

I have a web application with a number of subdomains that share the app but each has its own database. A PHP script is used to get the db appropriate for the subdomain.

Using .htaccess I can successfully password protect the directory but there is a problem.

Assuming I have sub1.domain.com and sub2.domain.com

Access is restricted with a .htgroup file with "allowed: sub1user sub2user" and a .htpasswd file. All cool so far - people need to log in - it works.

HOWEVER: If a person logs in to sub1.domain.com as sub1user and then types sub2.domain.com into address bar, they get access to the other subdomain.

I can see why this happens. All users belong to the group and the group has access to the folder so once a person is in...they are in.

How can I restrict a user to their own subdomain if all the subdomains share a common folder containing the script? Is it even possible?

Thanks so much in advance for any help.


Steve Davis

NOTE: This sig does not include any reference to voting, stars, or marking posts as helpful as doing so is cause for membership termination.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top