Hi All..
Well this is my first post. For the last couple of years, I was wondering about domainname.com/username. Which is actually pretty cool. Usually we have a long hyperlink domainname.com/userdetails/search.php?user='username' . These are quite lengthy and its quite difficult to remember also. Lets see how its done.
1. Create a ".htaccess" file using Notepad , Notepad++ or any other Word editing softwares
2. Enter the following lines to code to it
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ domainname.com/userdetails/search.php?user=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ domainname.com/userdetails/search.php?user=$1
3. And save those changes and upload .htaccess under your root directory [ Depends upon the scenario ]
4. Create a search.php File [Replace this php file as u wish]
echo $_GET['user'];
?>
5. Thats it you are done with it .. Now you can use the following link
domainname.com/username
Couple of Examples:
www.www.indianmagicians.com/philiptijuabraham
www.indianmagicians.com/magicvideo/Magicianphiliptiju
Advantages of having Static sorta URLs over dynamic URLs are:
* Static URLs Rank better in Search Engines.
* Static URLs are always more friendlier looking to the End Users, Basically easy to remember.
Hopes this article helped you
Tuesday, January 26, 2010
Subscribe to:
Comments (Atom)
