Sdafs Fasafs
Sdafs Fasafs

Reputation: 149

Nginx how to check if value is false

Now I'm doing a redirect with this code:

if ($args ~* "(utm_|gclid|fbclid)") {
 rewrite ^(.*)$ $uri? permanent;
}

and it will redirect if these parameters are added. But how can I do the opposite? In order not to redirect with these parameters, but the condition was false

Upvotes: 0

Views: 350

Answers (1)

pszemus
pszemus

Reputation: 403

According to docs, you can use a negative operator: !~*

Upvotes: 1

Related Questions