Open martinstepanek opened 2 years ago
Seeing a similar issue for this sample config:
const nextConfig = {
i18n: {
locales: ['en', 'cs'],
defaultLocale: 'en',
},
async rewrites() {
return {
beforeFiles: [
{
source: '/myapi/:path*',
destination: '/api/:path*',
},
],
};
},
}
https://localhost:3000/myapi/hello
returns a 404
It looks to have been introduced in https://github.com/vercel/next.js/releases/tag/v12.1.1-canary.6 and most likely this commit: https://github.com/vercel/next.js/pull/33966
@martinstepanek in next.config.js
i18n configuration, try to remove localeDetection: false,
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
When having configured i18n with domain-specific localization for two domains and rewrites configuration, app always redirects to defaultLocale localization
Expected Behavior
Rewrites should work as described in documentation and shouldn't redirect to different locale.
To Reproduce
Clear installation with domain-specific i18n and rewrites setup like below.
next.config.js
Visit example.cz domain and it immediately redirects you to example.com