Jump to content

Redirect users to a certin directory using php with htaccess


arcangel

Recommended Posts

I would like to know if its possible when a user log's into a directory using htaccess that the user based on the username entered it they can be redirected to there user directory using php and htaccess.

 

For example user go's to http://blah.com/client

 

Client enters Joe username and password for htaccess on the directory

Client Joe is then redirected to http://blah.com/client/joe directory 

 

 

Any help is greatly appreciated 

 

If I were to do something like this, I wouldn't be using htaccess at all. Just use PHP to re-direct the user to their directory:

 

 

//Get the users username by whatever means. This is a simple example of just grabbing it straight from the form POST.
$username = $_POST['username'];
header('Location: http://blah.com/client/'.$username);

 

That should work fine.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.