I am using IIS URL Rewrite and this one has stumped me.
I am redirecting a URL with specific subfolder to a new URL.
e.g. https://myapp.example.com/customsite1
redirected to https://newsite1-myapp.example.com
If I use this pattern:
^(.*)customsite1(.*)$
It works fine. The problem is there might be arguments added to the URL that also use the word customsite1
. So I thought "of course, the easy way to fix to this is match on /customsite1
"
But it never works.
^(.*)/customsite1(.*)$
will never match https://myapp.example.com/customsite1
even though the Test pattern feature says it will.
What am I missing here?
(.*)
subgroups in your regex for?