I am trying to create a page with profiles similar to facebook. The question I have is: instead of having a site that says www.sitename.com/profile.php?username=Username as the URL, I want the page to say www.sitename.com/Username.
I know to show a URL like the latter one, you would have an index page in a folder named Username, but I don't know how to do it dynamically and to show it as a subfolder.
I am using php as my main language.