How to make user friendly URLs?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Abosya
Forum Newbie
Posts: 1
Joined: Tue Dec 28, 2010 11:39 pm

How to make user friendly URLs?

Post by Abosya »

Hi guys,

I am trying to use URLs that look like this site.com/john.smith instead of looking like this site.com/?username=john.smith. I want my URLs to be user friendly and intuitive and don't know where to start.

Thanks in advance for your help!

Ab.
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: How to make user friendly URLs?

Post by Apollo »

Use mod_rewrite (.htaccess) to redirect any request to a single php file. Then in php, call the actual php script or generate output as needed.
Post Reply