diff --git a/packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts b/packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts index de9fefc553..7cf398ec38 100644 --- a/packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts +++ b/packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts @@ -91,9 +91,13 @@ export class RedirectsMiddleware { return redirects.find((redirect: RedirectInfo) => { return ( - (regexParser(redirect.pattern).test(req.nextUrl.pathname) || - regexParser(redirect.pattern).test(`/${req.nextUrl.locale}${req.nextUrl.pathname}`)) && - (redirect.locale ? redirect.locale === req.nextUrl.locale : true) + (regexParser(redirect.pattern.toLowerCase()).test(req.nextUrl.pathname.toLowerCase()) || + regexParser(redirect.pattern.toLowerCase()).test( + `/${req.nextUrl.locale}${req.nextUrl.pathname}`.toLowerCase() + )) && + (redirect.locale + ? redirect.locale.toLowerCase() === req.nextUrl.locale.toLowerCase() + : true) ); }); }