i18n breaks default routes for redirects/rewrites when locale: false
#57616
Labels
bug
Issue was opened via the bug report template.
Linking and Navigating
Related to Next.js linking (e.g., <Link>) and navigation.
stale
The issue has not seen recent activity.
Link to the code that reproduces this issue
https://github.com/iDVB/next.js/blob/i18n-rewrites
To Reproduce
i18n-routing
example on i18n-rewrites branchrewrites tests
2. Browse to http://127.0.0.1:3000/rewriteWithLocale
This WORKS
3. Browse to http://127.0.0.1:3000/fr/rewriteWithLocale
This WORKS
4. Browse to http://127.0.0.1:3000/rewriteWithoutLocale
This DOES NOT work (404)
5. Browse to http://127.0.0.1:3000/fr/rewriteWithoutLocale
This DOES NOT work (404)
redirects tests
5. Browse to http://127.0.0.1:3000/redirectWithLocale
This WORKS
6. Browse to http://127.0.0.1:3000/fr/redirectWithLocale
This WORKS
7. Browse to http://127.0.0.1:3000/redirectWithoutLocale
This DOES NOT work (404)
8. Browse to http://127.0.0.1:3000/fr/redirectWithoutLocale
This DOES NOT work (404)
Current vs. Expected behavior
Current
Disabling
locale
for a redirect/rewrite completely breaks that route even for the default route.Expected
Developers may want to disable locales for specific redirects/rewrites.
This should not disable those redirects/rewrites altogether, it should simply just disable the locale version of that route.
When disabled...
browsing here http://127.0.0.1:3000/redirectWithoutLocale should redirect to here https://cnn.com/business
and
browsing here http://127.0.0.1:3000/fr/redirectWithoutLocale should 404
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Routing (next/router, next/navigation, next/link)
Additional context
No response
The text was updated successfully, but these errors were encountered: