3

I need to redirect/rewrite an url that contains query string to the same url, but without query string. For example http://domain.com/a-post-title/?fbid=xyz to http://domain.com/a-post-title/ Sorry for my bad english.

1 Answer 1

3

Easy, just put a ? at the end of your rewrite, from http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite:

If a replacement string includes the new request arguments, the previous request 
arguments are appended after them. If this is undesired, putting a question mark at the 
end of a replacement string avoids having them appended
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.