I'm trying to redirect a page based on the parameters passed.
I would like redirect
rewrite ^/join_trial to /test? permanent;
and
rewrite ^/join_trial?discount=free(.*) /test2? permanent;
The first one works, but the second one doesn't. It looks like nginx doesn't take (.*) regex.
For the first one, the following cases work.
/join_trial?test=aaaaa
/join_trial?923849=aaa
Basically, you can put anything after /join_trial.
I want to have a redirect when a user appends ?discount=free(anything goes here).
Is this possible with nginx?