开发者

How to keep original parameters after url_rewrite?

I'm now doing this:

 rewriterule开发者_如何转开发 ^jobs/([0-9]+)/.* job.php?id=$1

Which will erase parameters in jobs/1010/title?k=v

How to keep them?


More of a serverfault question, but... Append the [QSA] flag:

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

From the docs for RewriteRule:

'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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜