PDA

View Full Version : Using .htaccess can I send users to different webpages


grungee
07-02-2006, 23:52/11:52PM
Using .htacces I know I can add a user and password to a folder but can I say send User1 to user1.html and User2 to user2.html is this possible? and any ideas on how to do it if it is?

JohnC
08-02-2006, 00:32/12:32AM
Are you asking in conjunction with the user filling the user : pass for access, or independently of the user : pass?

Blue
08-02-2006, 00:55/12:55AM
This (http://www.infoteam.com/support/hosting/htaccess.shtml) may work for you, if you set it up right.

grungee
08-02-2006, 00:56/12:56AM
Its for where say wholesaler1 has access to the wholesaler1 page and the wholesaler2 would have access to the wholesale2 page?

The password and user would be hand written, its supposed to be an easy/cheap fix to a small problem

Thanks Blue, I can set a user and password on a folder very simply, but what I want to do is set it so user1 sees user1.html and user2 sees user2.html

JohnC
08-02-2006, 01:00/01:00AM
If that is the case, you could use the suggestion Blue linked to and put each wholesalers page in a seperate directory if possible.

I dont think .htaccess can route a specific user to a specific file.

grungee
08-02-2006, 01:09/01:09AM
Thanks John, its a pain I thought I would be able to do it simply, I really didn't want to have 2 logins just a simple login and pass through to the right html, looks like more thought has to go into it.

g1smd
09-02-2006, 17:39/05:39PM
You need the simplest of PHP scripts with a list of users, passwords and destinations stored in a flat text file (or in a database file if more than a few dozen people are involved). The login screen would take the username and password, validate it, and then either redirect to the right page or reject for an invalid user.

grungee
11-02-2006, 03:40/03:40AM
Thanks G1 will definately look into that, I was sure it could be done with .htaccess, but I have failed so far. Will jump onto what you say and see how it goes, many thanks.