Search code examples
phpurlurl-routingbookmarks

How do bookmarks work?


Im interesting in how bookmarks work for social networks sites like facebook for example, when you look at someone's profile its

www.facebook.com/customname

or if they didnt make one yet its

www.facebook.com/generatedname

Is there a get request somewhere im missing??? Is the

www.facebook.com/profile.php?key= 

hidden in the url? But how does the server know to interpret the url to look for someone's profile page? How does it work!!!!! Thanks!


Solution

  • Yes, the request is usually hidden using rewrite engines such as mod_rewrite.

    As such something like facebook.com/customname is rewritten to facebook.com/profile.php?key=customname, which then internally looks up the correct profile page from the database.