Page 1 of 1

PHP Url Shortcut

Posted: Mon May 01, 2006 9:50 am
by nowhere903
I am completely a newbie.
On my site I want to do the following:

When a user types in http://www.mysite.com/username

I want "username" to be checked in the database table and then redirected to a page displaying that information along that table.

Kind of like viewing a profile.

I can't find anything on this subject. What do I need to do?

Any code examples or links to other topics on this subject would be appreciated.

Thanks in advance.

Posted: Mon May 01, 2006 10:01 am
by timvw
What have you searched for already? A websearch with the terms 'url rewriting' or 'mod_rewrite' will provide you various examples and inspiration.. Even a search on this forum would return lots of resources.

Posted: Mon May 01, 2006 10:09 am
by nowhere903
I have been searching for "url PHP shortcut" etc. ALong those terms. I will search with the given strings you have gave me. Is there anything set in stone with the exact result I am trying to achieve.
Thanks for the quick reply.

Posted: Mon May 01, 2006 12:42 pm
by timvw
I presume that you already know how to write a script that displays the account information if the id is given...

Usually it's as simple as having a rewrite rule that maps /accounts/(.*) to /account.php?id=$1...