Apache 重定向规则重定向查询参数中存在的 URL

Apache Redirect Rule to redirect URL present in query parameter

我有一个URL

www.xyz.com/test/?redTo=www.abc.com||www.google.com&state=abdhs7899928392

我想将此 URL 重定向到

www.google.com.com/?redTo=www.abc.com||www.google.com&state=abdhs7899928392

("||" 是静态的,我想从 redTo 查询字符串中获取 www.google.com 并将所有参数按原样传递给 www.google.com,如上文 url 所示)

使用这个:

RewriteEngine On
RewriteCond %{QUERY_STRING} redTo=([^&\s]+)
RewriteRule ^/test http://%1