<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi guys, </span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I'm trying to rewrite an url with a few parameters, but unsuccessfully.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">The URL:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
<div><a href="https://www.mysite.com.br/category-body/categories/promotionalXXX?utm_source=PromoCode&utm_medium=AddPromo&utm_campaign=PromoCode_AddPromo_moneycampaing" target="_blank">https://www.mysite.com.br/category-body/categories/promotionalXXX?utm_source=PromoCode&utm_medium=AddPromo&utm_campaign=PromoCode_AddPromo_moneycampaing</a></div>
<div><br></div><div>I need rewrite to:</div><div><br></div><div><a href="https://www.mysite.com.br/digital-parts/newspaper/recs-xyaw-sazz-qqad-cxae" target="_blank">https://www.mysite.com.br/digital-parts/newspaper/recs-xyaw-sazz-qqad-cxae</a></div>
</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">The /promotionalXXX can be /promotional123, /promotional324 and many more ... </div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">What i already tried:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>
rewrite ^/category-body/categories/promotional(.*)utm_source=PromoCode&utm_medium=AddPromo&utm_campaign=PromoCode_AddPromo_moneycampaing<a href="https://www.mysite.com.br/digital-parts/newspaper/recs-xyaw-sazz-qqad-cxae" target="_blank">https://www.mysite.com.br/digital-parts/newspaper/recs-xyaw-sazz-qqad-cxae</a>;</div>
<div><br></div><div>and ...</div><div><br></div><div>location = /category-body/categories/promotional(.*)$ {</div><div><span style="white-space:pre-wrap"> </span>if ($args ~ “utm_source=PromoCode&utm_medium=AddPromo&utm_campaign=PromoCode_AddPromo_moneycampaing”) {</div>
<div><span style="white-space:pre-wrap"> </span>rewrite ^/digital-parts/newspaper/recs-xyaw-sazz-qqad-cxae; permanent;</div><div><span style="white-space:pre-wrap"> </span>}</div><div>}</div></div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">But any of this worked for me... </div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
What's the best way to solve this?</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks!</div>
</div>