Hello
I am working on a site http://mygradregistry.com.
When user goes to link " http://mygradregistry.com/username "
then it should display the content of page "http://mygradregistry.com/profile.php" .
How I can achieve this requirement?
If htaccess is the best method then how I can do it with htaccess?
User friendly URL using htaccess
Moderator: General Moderators
-
sunil_23413
- Forum Newbie
- Posts: 10
- Joined: Thu Mar 12, 2009 5:43 am
Re: User friendly URL using htaccess
Okay, but I have a question: what if /username already exists? What if the username is "images"?
Re: User friendly URL using htaccess
I've seen many websites overcoming the problem tasairis describes by assigning a tilde before the username, which means:
This url:
domain.com/~<the username>
becomes this url:
domain.com/profile.php?username=<the username>
I'm sure this site can help you create the proper .htaccess file: http://corz.org/serv/tricks/htaccess2.php
EDIT: alternatively you can have: domain.com/user/<the username> becoming domain.com/profile.php?username?<the username>
This url:
domain.com/~<the username>
becomes this url:
domain.com/profile.php?username=<the username>
I'm sure this site can help you create the proper .htaccess file: http://corz.org/serv/tricks/htaccess2.php
EDIT: alternatively you can have: domain.com/user/<the username> becoming domain.com/profile.php?username?<the username>