diff --git a/src/i18n.ts b/src/i18n.ts index 6410fe8..10fd8f4 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -1,12 +1,10 @@ +import {notFound} from 'next/navigation'; import {getRequestConfig} from 'next-intl/server'; -export const locales = ['en']; -export const defaultLocale = 'en'; - +const locales = ['en']; + export default getRequestConfig(async ({locale}) => { - if (!locales.includes(locale as any)) { - locale = defaultLocale; - } + if (!locales.includes(locale as any)) notFound(); return { messages: (await import(`../messages/${locale}.json`)).default diff --git a/src/middleware.ts b/src/middleware.ts index 093eaab..697c130 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -6,5 +6,6 @@ export default createMiddleware({ }); export const config = { - matcher: ['/((?!api|_next|_vercel|.*\\..*).*)'] + // Match only internationalized pathnames + matcher: ['/', '/(en)/:path*'] }; \ No newline at end of file