标签云

微信群

扫码加入我们

WeChat QR Code

I would like to redirect visitors who go to:http://example.com/?document=whatever&blah1=x&blah=yTo:http://example.com/newsite/?document=whatever&blah1=x&blah2=ySo basically I want to (only) replace:?documentWith:newsite/?documentAnd leave the rest of the URL unchanged. If the request does not contain ?document I just want to leave it alone.EDITI've tried the following which does the redirect correctly, however I get stuck in a redirect loop because it still finds the query parameter next time around.RewriteEngineonRewriteCond %{QUERY_STRING} documentRewriteRule / /newsite/ [R,L]Can I modify this so rewrite doesn't happen if "newsite" is in the URL, or maybe rename the document query parameter to redocument so it doesn't get picked up by the rule next time around? Any other suggestions?Thanks!


RewriteRule "^\?document(.*)" "example.com/newsite/&document$1"

2019年04月19日34分07秒