I was wondering if it possible to format URL with PHP? I'm not sure if it the right question but I'm going to make it as clear as possible. I want to create a folder for every user that signed up on my website. But I don't want too much files in the root directory, so the have create them on folder [USERS]. The problem is the URL will look like this: http://www.mywebsite.com/users/username/ But I want them to look like this: http://www.mywebsite/username/ Is it possible to achieve this with PHP? Thanks EDIT: On searching, there is something to to with the .htaccess file. But how to write it.
It's your choice whether you want to maintain separate physical folders for each user, or to implement the same functionality with Apache Mod Rewrite. In this I should say, most of the websites today, are implementing hierarchical URL structure by rewriting URLs, not by maintaining separate folder. This reduces the effort of web design, maintenance and the size of website.
Thank techbongo I think I would choose the last choice you have suggested. I am still learning. I would go with that "implementing hierarchical URL structure by rewriting URLs" thing, because it sounds saving space and improving speed. But there's a dilemma of how to allot them use space though.