Jump to content


Photo

user directories management


  • Please log in to reply
4 replies to this topic

#1 keenk

keenk
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 13 July 2006 - 06:46 PM

this is a slightly more general question but as i am programming it in php, it is related.

i am wondering what is the best way to create clean user-specific urls for each user registered on a website.  i explain.  take del.icio.us for example.  a user's main url is 'http://del.icio.us/username' and match with its rss feed 'http://del.icio.us/rss/username'.  i am wondering if when the user registers, different folders are created (/username, and /rss/username) with files in them.  how does it work?

#2 micah1701

micah1701
  • Members
  • PipPipPip
  • Advanced Member
  • 613 posts
  • LocationEllington, CT USA

Posted 13 July 2006 - 06:49 PM

I'm not sure exactily how that site does it, but its probably not individual directories.
check out this article at sitepoint

http://www.sitepoint...e-friendly-urls
"Confidence in the face of risk."

#3 Kurt

Kurt
  • Members
  • PipPipPip
  • Advanced Member
  • 42 posts
  • LocationNew York

Posted 13 July 2006 - 06:49 PM

They probably use .htaccess to do this.

#4 keenk

keenk
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 13 July 2006 - 07:07 PM

thanks that's exactly what i needed.

if del.icio.us use .htaccess by redirecting error pages, they must have one hell of an error log.

#5 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 13 July 2006 - 07:33 PM

Nope, they probably use mod_rewrite, an addon for Apache which allows for rewriting of URLs to the backend.

Note that when you rewrite a URL e.g: /user3/ to backend ?user.php?id=3 that the browser will look for images etc. in www.site.com/user3/ so you have to hardcode your resources. It's handy to know before you start.
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users