Here are my nginx rewrite rules
rewrite ^(.*)$ http://www.destination.com/main.php?utm_source=xxx&utm_medium=yyy&utm_campaign=zzz permanent;
Everything works so far except when there's query arguments.
This is a permanent 301 redirect, and I need to configure the case when there's query string, it will be appended before the utm tracking query.
How do I do this while also taking care of rewrite without query string?
eg.
http://www.from.com/?test=ABC
goes to
http://www.destination.com/main.php?test=ABC&utm_source=xxx&utm_medium=yyy&utm_campaign=zzz
instead of
http://www.destination.com/main.php?utm_source=xxx&utm_medium=yyy&utm_campaign=zzz&test=ABC