1

我正在尝试编辑/修改查询字符串的值。

RewriteCond %{QUERY_STRING} [^|&]return_to=(.*)[&|$] [NC]
RewriteRule /login https://domain/login?return_to=https://otherdomain/%1 [QSA,R] 

为了清楚起见,我添加了空格!鉴于此输入:

https://domain/login ?user=me &return_to=somepage.html

我期待这个:

https://domain/login ?user=me &return_to=https://otherdomain/somepage.html

但我明白了:

https://domain/login ?return_to=https://otherdomain/true &user=me &return_to=somepage.htm

首先,为什么“真实”?其次,它为什么不编辑现有的 val,而是将其添加到前面(我知道 QSA 会进行该编辑)。

4

0 回答 0