我需要redirect/重写包含查询string的url到相同的url,但没有查询string。 例如http://domain.com/a-post-title/?fbid=xyz到http://domain.com/a-post-title/对不起,我的英文不好。
简单,只要放一个?
在重写结束后,从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