File tree Expand file tree Collapse file tree 1 file changed +1
-21
lines changed Expand file tree Collapse file tree 1 file changed +1
-21
lines changed Original file line number Diff line number Diff line change @@ -24,27 +24,7 @@ export default async function middleware(request) {
24
24
return NextResponse . next ( )
25
25
}
26
26
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
48
28
const response = await intlMiddleware ( request )
49
29
50
30
// Log the response
You can’t perform that action at this time.
0 commit comments