聘我网

新概念招聘3.0

url重写后如何保留原有参数?

vote up0vote downstar

用这段重写规则,会丢失原有的参数信息:

rewriterule ^jobs/([0-9]+)/.* job.php?id=$1

对于请求jobs/1010/title?k=v,其中的GET参数k=v将会丢失,解决方法是[QSA]:

rewriterule ^jobs/([0-9]+)/.* job.php?id=$1 [QSA]

QSA相关文档

'qsappend|QSA' (query string append)

This flag forces the rewrite engine to append a query string part of the substitution string to the existing string, instead of replacing it. Use this when you want to add more data to the query string via a rewrite rule.

 

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.