.htaccess redirects according to user/pw combination?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
prue_
Forum Commoner
Posts: 64
Joined: Thu May 07, 2009 10:34 pm

.htaccess redirects according to user/pw combination?

Post by prue_ »

Hi all,

I need to set up an .htaccess file in a root folder that requires a username and a password, and will direct the user to a different folder depending on the username and password entered.

E.g.:

1. The user goes to http://www.example.com/
2. They enter their username (bobsmith) and password (923r9w8c2w)
3. They are redirected to http://www.example.com/bobsfolder/
4. If a user goes to http://www.example.com/bobsfolder/ directly, they are prompted for a user name and password BUT do not have to re-enter it if they have already.


This is so that I can have multiple folders and multiple users, but only need to provide them with one common link.

Does anyone know if and how this can this be done? Thanks for reading this.
User avatar
starram
Forum Commoner
Posts: 58
Joined: Thu Apr 10, 2008 1:27 am
Location: India
Contact:

Re: .htaccess redirects according to user/pw combination?

Post by starram »

Are you going to create folder for every user?
prue_
Forum Commoner
Posts: 64
Joined: Thu May 07, 2009 10:34 pm

Re: .htaccess redirects according to user/pw combination?

Post by prue_ »

thanks starram, there are folders already for the users.. is this doable with htaccess, or it should be done with php or javascript? thanks again
Post Reply