I have the following rewrite rule in my nginx:
rewrite ^/(.*)/$ /$1 permanent;
to remove trailing slash at the end of any URL. However I wanted to make an exception such that when the URL is
/register/ I don't want this rule to be applied. How do I put that into the regex?
You can use a <strong>Negative Lookahead</strong>.
If you don't want
register anywhere between such as
/exampleregister/, use the following.