Forum Moderators: phranque

Message Too Old, No Replies

using .htaccess to redirect specific users?

         

hedbanger

8:35 pm on Feb 28, 2004 (gmt 0)



I'm pretty new to .htaccess and I'm wondering how i would redirect certain users, to their own specifc directory?

if i had an .htaccess file in directory 'clients', how could I for example, redirect user 'bob' (if password is correct) to 'clients/bob'?

and how could i redirect user 'dan' to 'clients/dan' (if password is correct)?

I'm trying to build a login system that redirects each user to their own directory, while not letting the other users access eachothers directories...

Thannks alot lot guys..
- Kyle

jdMorgan

11:26 pm on Feb 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Kyle,

Welcome to WebmasterWorld [webmasterworld.com]!

I suppose you could use a RewriteRule based on a RewriteCond %{REMOTE_USER} test.

However, the problem is that you'll need to be careful with the authentication domain in order to keep the users out of each other's directories. If not done properly, you'll end up needing a site login *and* a user login.

Anyway, that's a first step...

Ref: Introduction to mod_rewrite [webmasterworld.com]

Jim