Reputation: 27038
I have these test cases:
/test
/test/
/test/whatever
I would like to write an nginx rewrite rule that only targets /test/whatever
I currently have
rewrite ^/(test/)(.*) /some-other-page;
but this targets all the above cases.
Any ideas?
Upvotes: 2
Views: 2815
Reputation: 626738
The ^/(test/)(.*)
will match /test/
because .*
can match an empty string.
You may use
^/test/(.+)
The .+
will require at least 1 char after /test/
.
Upvotes: 2