Web redirection based on username

Web redirection based on username

Author
Discussion

arcturus

Original Poster:

1,492 posts

268 months

Tuesday 4th May 2004
quotequote all
I currently protect parts of websites using .htaccess and .htpasswd. Works well but I now want something a little better.

How can I redirect a user to a personalised page on the website based on the username and password that they type in - you know , just like when you log into your online banking or whatever.

I use Apache servers and can use perl or php if needed - asp is not available.

Or is the best way to use the Apache mod_rewrite module?

Any ideas need to be server not client based.

Suggestions or pointers gratefully received - the simpler the better!!

JamieBeeston

9,294 posts

270 months

Tuesday 4th May 2004
quotequote all
this could be simply achieved using a simple PHP script,

it could authenticate users, and then forward them onto the desitnation directory of your choosing depending on their username.

This shouldnt be hard at all, I would place money on there being several free scripts out there already which could do exactly this.

HTH

arcturus

Original Poster:

1,492 posts

268 months

Tuesday 4th May 2004
quotequote all
Yes, I have been Googling for such items and I have a couple of candidates.

I was wondering if that was the best way to do it or if I was missing something obvious with .htaccess.

JamieBeeston

9,294 posts

270 months

Tuesday 4th May 2004
quotequote all
afaik, htaccess is just for protecting access to a dir / sticking in 'on the fly' directives for certain dirs.

You cant assigned different 'end paths' from it, as its only run on a per directory basis.

You possibly could do something funky with overriding the standard error pages, and then redirecting unsuccessful attempts to another directory, but that would be about the extent of it.

PHP is the easy option.