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 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.