Skip to content

Commit bd06a7e

Browse files
committed
make intl work again
1 parent b5f2580 commit bd06a7e

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

middleware.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,7 @@ export default async function middleware(request) {
2424
return NextResponse.next()
2525
}
2626

27-
// Check if path already has a locale
28-
const pathname = request.nextUrl.pathname
29-
const pathnameHasLocale = routing.locales.some(
30-
(locale) => pathname.startsWith(`/${locale}/`) || pathname === `/${locale}`
31-
)
32-
33-
if (pathnameHasLocale) {
34-
console.log("⏭️ Path already has locale, skipping middleware")
35-
return NextResponse.next()
36-
}
37-
38-
// Force redirect to default locale for root path
39-
if (pathname === "/") {
40-
const response = NextResponse.redirect(
41-
new URL(`/${routing.defaultLocale}`, request.url)
42-
)
43-
console.log(`📤 Redirecting root to: ${routing.defaultLocale}`)
44-
return response
45-
}
46-
47-
// Call the next-intl middleware for all other paths
27+
// Call the next-intl middleware for all paths
4828
const response = await intlMiddleware(request)
4929

5030
// Log the response

0 commit comments

Comments
 (0)