Page 1 of 1

CMS implementation question: http://<url>/<userlogi

Posted: Tue Jun 19, 2007 8:08 pm
by mechamecha
Hey all,
I've seen a lot of CMS that give registered users a "/username" location to the site (ie. myspace). How exactly is this implemented? Does the CMS create a new directory with the users name at the root of the site on the host? I can see how this could be implemented using the file system calls in PHP, however, it seems like this approach would clutter the site as the the registered user base grew to the millions.

So it would seem that perhaps there is a mapping system in place that maps the "/username" syntax to a php file w/ an argument, such as "index.php?username=username". How would such a mapping system be built?

Thanks

Re: CMS implementation question: http://<url>/<user

Posted: Tue Jun 19, 2007 8:19 pm
by John Cartwright
mechamecha wrote:So it would seem that perhaps there is a mapping system in place that maps the "/username" syntax to a php file w/ an argument, such as "index.php?username=username". How would such a mapping system be built?
Bingo! It actually is quite simple, however I'm not inclined to break it down as we've discussed this so many times. Keywords to search for "mod_rewrite", "clean urls", "pretty urls"

Posted: Thu Jun 21, 2007 3:27 pm
by mechamecha
Jcart,
Thanks for the heads up! Now that I know what the term is called, I can learn all about it from google.

Posted: Thu Jun 21, 2007 4:45 pm
by John Cartwright
mechamecha wrote:Jcart,
Thanks for the heads up! Now that I know what the term is called, I can learn all about it from google.
Searching this forum for those terms has some useful threads on the matter, although feel free to follow up with any specific questions.