Hey guys I have a question. I wanna create a profile page for each new user, and I noticed that on facebook you could simply type in http://www.facebook.com/username and you get to the user’s page, my question is, how can I do this without something like domain.com/users.php?useraname=”username” or something like that? How can I simply make it like the facebook one?
Share
What you are looking for is mod_rewrite. This will allow you to write PHP code that appears to the end user to be a directory on the server (such as http://www.facebook.com/user.php?username into http://www.facebook.com/username.)
An introduction to them with PHP can be found here: http://wettone.com/code/clean-urls
Please note you will need to enable it on your server. That should be possible in the .htaccess file if you’re running an Apache server.