From 7b9b7a0dd7f6b1553b0920eeb43172ca05c87af5 Mon Sep 17 00:00:00 2001 From: javayhu Date: Sun, 20 Jul 2025 13:02:41 +0800 Subject: [PATCH] chore: handle internal docs link redirection for internationalization --- src/middleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middleware.ts b/src/middleware.ts index 2052b9e..0e90f65 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -33,7 +33,7 @@ export default async function middleware(req: NextRequest) { // Handle internal docs link redirection for internationalization // Check if this is a docs page without locale prefix - if (nextUrl.pathname.startsWith('/docs/')) { + if (nextUrl.pathname.startsWith('/docs/') || nextUrl.pathname === '/docs') { // Get the user's preferred locale from cookie const localeCookie = req.cookies.get(LOCALE_COOKIE_NAME); const preferredLocale = localeCookie?.value;