I have the following problem:

I would like to give my site-members an easy access to thier personal page. Example:

This is my database structure:

+------+-------------+
| id | name |
+------+-------------+
| 9 | Henk |
| 10 | Erik |
+------+-------------+

When a member goes to:

http://www.domain.com/users.php?id=10

He will see his personal page.

But I would like to make it more easier:

http://www.domain.com/erik

must redirect to http://www.domain.com/users.php?id=10

I have already heard that this is possible with .htaccess. But can someone help me to make this works.

Thanx in advance

Henk Erik

    Why not create a user login system since you have already done the fundamental task of building a user database. It is generally better to avoid having people type in the URL address.

    I am doing exactly what you are attempting on my own website. Visit AaronZoller.com for a working example of such a user login system.

    AaronZoller.com

    P.S. If you want to go my route, and need more help, let me know.

      This is just an idea - I have not tested it.

      In your httpd.conf define:
      ErrorDocument 404 /404.php

      than in 404.php do a parsing of the requsted url ($PHP_REQUEST_URI or something like that) and do the redirecftion by

      header("Location: $redirected_url");

        Write a Reply...