用户个人资料的友好网址? [英] friendly urls for users profile?
问题描述
您好,我想为用户url创建格式,例如为用户ninja123创建格式,他将获得example.com/ninja123的配置文件链接,即时通讯在apache上使用php mysql.这是正常链接!
hello i wanted to create a format for users url, for example for the user ninja123, he would get a profile link of example.com/ninja123, im using php mysql on apache. this is the normal link!
viewprofile.php?userid=2
我该如何解决这个问题?而且我是一个不好的.htaccesss新手:))谢谢
how could i appraoch this problem? and im a bad .htaccesss newbie :)) thanks
推荐答案
代替执行$_GET['userid']
并查找ID ...通过查找名称来切换它,就像:viewprofile.php?userid=Ninja123
Instead of doing $_GET['userid']
and looking for ID... switch it by looking for name so it's like: viewprofile.php?userid=Ninja123
尝试使用此Mod Rewrite生成器: http://www.generateit.net/mod-rewrite/
Try this Mod Rewrite generator: http://www.generateit.net/mod-rewrite/
这篇关于用户个人资料的友好网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!