regex – NGINX regexp or statement for redirect
I currently have the following NGINX config to redirect all .html requests to the non .html prefix URI if “static” is not in the request URI:
if ($request_uri ~ ^/(?!static/)(.*)\.html) {
return 301 /$1$is_args$args;
}
However, I also want to avoid redirecting to the non .html variant if the request contains “googled” in the URI for the tag manager verification.
I’ve tried adding OR statements
in this expression, but I can’t seem to figure it out because I lack the knowledge to do something like that in regexp.
How would I add an OR statement
in this case?
Read more here: Source link