mod_rewrite > /用户/tag1/tag2/tag..?page=1
我正在尝试使用 mod_rewrite 来美化 URL。
我希望 URL 看起来像这样:
http://example.com/bart/school?page=2
重写的 URL 为:
http://localhost:8080/app?user=bart&tag1=school&page=2
如果可能,我还希望每个用户能够拥有多个标签:
http://example.com/bart/school/lisa?page=2
看起来像:
http://localhost:8080/app?user=bart&tag1=school&tag2=lisa&page=2
据我所知,通过使用这是可能的mod_rewrite 但我似乎无法弄清楚。任何帮助将非常感激!
I am trying to use mod_rewrite to pretty up a URL.
I want the URL to look like this:
http://example.com/bart/school?page=2
and the rewritten URL to be:
http://localhost:8080/app?user=bart&tag1=school&page=2
If possible, I would also like to be able to have more than one tag per user:
http://example.com/bart/school/lisa?page=2
Would look like:
http://localhost:8080/app?user=bart&tag1=school&tag2=lisa&page=2
I far as I can tell this is possible by using mod_rewrite but I can't seem to figure it out. Any help would be really appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于单个标签,请使用以下内容:
For the single tag use the following: