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

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
mechamecha
Forum Commoner
Posts: 32
Joined: Thu May 31, 2007 8:49 pm

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

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

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

Post 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"
mechamecha
Forum Commoner
Posts: 32
Joined: Thu May 31, 2007 8:49 pm

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
Post Reply