这是 url 重写不起作用
我尝试创建此 url 规则但不起作用:我不知道为什么 :(
原始 url
www.example.com/viewprofile.php?username=jhon
所需的友好 url 是
www.example.com/user/jhon
这是 my.htaccess 代码:
RewriteEngine On
RewriteRule ^username/([^/]*)$ /viewprofile.php?username=$1 [L]
感谢您的帮助!!:))
i tried to create this url rule buts not working: i dont know why :(
orginal url
www.example.com/viewprofile.php?username=jhon
the desired friendly url is
www.example.com/user/jhon
this is my.htaccess code:
RewriteEngine On
RewriteRule ^username/([^/]*)$ /viewprofile.php?username=$1 [L]
thanks for helping!! :))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现这个教程的作者一步步解释了如何准确地完成您想要做的事情。看看是否有帮助: http://www.emanueleferonato.com/2008/06/15/how-to-generate-friend-urls-with-htaccess-part-2/
I found this tutorial where the author explain step by step how to do exactly what you are trying to do. See if it helps: http://www.emanueleferonato.com/2008/06/15/how-to-generate-friendly-urls-with-htaccess-part-2/