Rewrite的QSA是什么意思?

原版的英文:

When the replacement URI contains a query string, the default behavior of RewriteRule is to discard the existing query string, and replace it with the newly generated one. Using the [QSA] flag causes the query strings to be combined.

Consider the following rule:

RewriteRule /pages/(.+) /page.php?page=$1 [QSA]

With the [QSA] flag, a request for /pages/123?one=two will be mapped to /page.php?page=123&one=two. Without the [QSA] flag, that same request will be mapped to/page.php?page=123 - that is, the existing query string will be discarded.

 

大意就是: 使用了[QSA]标记 /pages/123?one=two  会变成这样 /page.php?page=123&one=two

没有使用就只能这样,(就是说.?之后的不包括在(.*)里)/page.php?page=123

你可能感兴趣的:(rewrite)