From d728108b3ec622f948f52234dc0e2f44cb0b5622 Mon Sep 17 00:00:00 2001 From: MichalC <103170279+wSBMichalee@users.noreply.github.com> Date: Mon, 31 Aug 2026 22:40:07 +0200 Subject: [PATCH] fix: ignore static assets in locale middleware matcher --- src/proxy.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/proxy.ts b/src/proxy.ts index 94e6a47..0bb2603 100644 --- a/src/proxy.ts +++ b/src/proxy.ts @@ -5,6 +5,10 @@ import { i18n } from './i18n.config'; const localeMiddleware = createLocaleMiddleware({ config: i18n }); +export const config = { + matcher: ['/((?!api|admin|_next|.*\\..*).*)'], +}; + export default function proxy(req: NextRequest) { const r = localeMiddleware(req); const res = r.type === 'next' ? NextResponse.next() : NextResponse.redirect(new URL(r.location, req.url));