mod_rewrite查询字符串 [英] mod_rewrite query string
本文介绍了mod_rewrite查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个类似的查询字符串
I have a query string like
search.php?id=12&keyword=abc&api=gIUTG6898
我希望URL像这样:
search/?id=12&keyword=abc&api=gIUTG6898
现在,我发现了很多解决方案,但它们仅限于查询字符串中的一个变量.预先感谢
Now I found a lot of solutions but they are limited to only one variable in the query string. Thanks in advance
推荐答案
由于要删除.php并将其替换为斜杠,因此您需要稍微反转Floern的RewriteRule:
Since you are wanting to remove the .php and replace it with a slash, you'd need to reverse Floern's RewriteRule somewhat:
RewriteRule ^/search.php$ /search/ [QSA,L]
这篇关于mod_rewrite查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文