I’ve my domain structure as domain.com/username (just like in twitter/facebook etc).
My knowledge is that, I’ve to create a directory with the username and put files inside it to be view from that URL.
Is there a better way to handle the URL without creating the directories for every user and just retrieving the URL and finding out which user’s page it is & loading the user data from the database from the main domain only (ie domain.com index page)??
mod_rewrite
http://www.workingwith.me.uk/articles/scripting/mod_rewrite
Basically, your “real” URL would look like
domain.com/profile.php?name=Andrew, and it would show all the information for the user with that name. You could then use mod_rewrite and makedomain.com/andrewa “shortcut” todomain.com/profile.php?name=Andrew.Just tested this, and it worked fine:
profile.php –
.htaccess –
When I visit http://localhost/andrew, I see my name, just like I should.