Possible Duplicate:
.htacces to create friendly URLs. Help needed
I am using ids to display the records (profiles ) of members.
So /profile.php?id=1 displays the data of member with id 1.
But these urls are ugly and not SEO friendly either.
I want change the urls to the format profiles/membername (membername is a unique alias for each member already stored in the db).
How can I achieve this link structure through .htaccess?
This requires apache’s mod_rewrite module to be installed. What you want can be achieved through the following piece of code:
Example:
http://www.yourwebsite.com/profiles/1234 -> http://www.yourwebsitename.com/profile.php?id=1234
If you want more variables just modify the above line like below:
Just edit your .htaccess file and add the above lines, make sure you create a backup of your .htaccess before making any modifications.