username urls like twitter and facebook

后端 未结 4 932
心在旅途
心在旅途 2021-01-03 16:07

how does twitter and facebook etc. make unique url eg. twitter.com/billgates

if i would like to do the same (give my users unique urls with username), is it a appli

4条回答
  •  难免孤独
    2021-01-03 16:09

    More generally these online services (Facebook, Twitter, any site that stores a username) use a database and tests for so see if the username is unique at the time of creation. Usually by querying the name before allowing the new account to be created (many do this with ajax requests as the user enters the name in the signup form).

    Once the account is created then the server can be set up to handle the path name (using something like mod_rewrite) when a URL request is received, and pass along the information to a script that then accesses that user's information in the database and renders the page.

    This blogpost & video seem to be pretty helpful but since I'm not sure what your setup is it should at least point you in the right direction... Also Coldfusion scares me.

提交回复
热议问题