Geta / geta-notfoundhandler

The popular NotFound handler for ASP.NET Core and Optimizely, enabling better control over your 404 page in addition to allowing redirects for old URLs that no longer works.
Apache License 2.0
20 stars 16 forks source link

Regex Redirect Unsual redirects #136

Open mmtadam opened 1 month ago

mmtadam commented 1 month ago

Hi,

I'm seeing some odd redirect using the regex redirect in the optimizely CMS, they passed me over here.

When I navigate to /careers/search?searchTerm=early) careers professionals &default=false&filterOption=exact&countryFilters=[{"filterName":"Country","filterValue":"Singapore"}]

The regex is set to redirect to /careers/explore-our-careers/?take=12

However what I end up getting is /en/careerssearch/?searchTerm=early%20careers%20professionals%20&default=false&filterOption=exact&countryFilters=[%7B%22filterName%22:%22Country%22,%22filterValue%22:%22Singapore%22%7D]

I tried with another url without the params in case that was the issue /careers/test and it became /en/careerstest so what it seems to be doing is just removing the slash and adding en in front and I'm not sure why. The 2 regexs are (https:\/\/)(.)({domain}.com\/careers\/search)(.) (https:\/\/)(.*)({domain}.com\/careers\/)(.+)

Any advice would be greatly appreciated