Skip to content

Commit 81ce185

Browse files
committed
fix: redirect isr index pages without a sub path
1 parent 0e9c098 commit 81ce185

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/runtime/src/helpers/redirects.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ const generateStaticIsrRewrites = ({
143143
return
144144
}
145145
// The default locale is served from the root, not the localised path
146-
if (i18n?.defaultLocale && route.startsWith(`/${i18n.defaultLocale}/`)) {
147-
route = route.slice(i18n.defaultLocale.length + 1)
146+
if (i18n?.defaultLocale && route.startsWith(`/${i18n.defaultLocale}`)) {
147+
route = route.slice(i18n.defaultLocale.length + 1) || '/'
148148
staticRoutePaths.add(route)
149149
if (matchesMiddleware(middleware, route)) {
150150
staticIsrRoutesThatMatchMiddleware.push(route)

0 commit comments

Comments
 (0)