开发者

Facebook user url system

In my project every user have his own page. But i wanna assign url to theese pages like in facebook: facebook.com/username. How does facebook开发者_Python百科's profile url system work? How to create pages for user like in Facebook (domain.com/username)? Sorry for my bad english


Well you need to search after mod_rewrite it allows to rewrite URLS to another url like the facebook one.

More information on the apache site: http://httpd.apache.org/docs/current/mod/mod_rewrite.html


You need a .htaccess file with mod_rewrite rules (tutorial) that pushes those requests to a .php file. There you can look at the original request, and fetch the user details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜