Results 1 to 6 of 6
  1. #1

    Redirect to different page, using htaccess

    I have password protected folders, using htaccess... in the file there are many users, that can enter the folder... The issue is: I want to redirect the user, depending on his username, to his own page... HOWTO???

  2. #2
    Join Date
    Oct 2001
    Mountain Home Arkansas
    PHP has a predifinded variable that will return the username based on your .htaccess user list.

    rocket science is more fun when you accually have rockets!

  3. #3
    So how do I use it? For example - I have login page, on the index page /home page/ - then the user types his username and password.. how do I redirect him to his own page?

  4. #4
    Join Date
    Oct 2004
    You dont have to redirect them to their own page, you redirect them to one page for all of them, but change the information or the MySQL query based on the username entered, ie: Using $_SERVER['PHP_AUTH_USER']

  5. #5
    Join Date
    Jun 2004
    Bay Area -USA
    You could do something like this:

    Members folder is :
    Each user could have something like:

    So when they log in using .htaccess to
    on the index.php page of that you could have something such as:

    PHP Code:
    if(isset($_SERVER['PHP_AUTH_USER'])) {
    Hope this helps.
    <<< Please see Forum Guidelines for signature setup. >>>

  6. #6
    Great help it was, indeed
    Let the Power be with you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts