Unverified Commit d9bb645c authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Mention regex route behavior with i18n (#22500)

This mentions how locale routes are transformed when `locale: false` is not used to explain why regex routes might not match with i18n. 

Closes: https://github.com/vercel/next.js/issues/21507
parent b90b4b50
...@@ -227,6 +227,17 @@ module.exports = { ...@@ -227,6 +227,17 @@ module.exports = {
}, },
], ],
}, },
{
// this gets converted to /(en|fr|de)/(.*) so will not match the top-level
// `/` or `/fr` routes like /:path* would
source: '/(.*)',
headers: [
{
key: 'x-hello',
value: 'worlld',
},
],
},
] ]
}, },
} }
......
...@@ -152,6 +152,13 @@ module.exports = { ...@@ -152,6 +152,13 @@ module.exports = {
locale: false, locale: false,
permanent: false, permanent: false,
}, },
{
// this gets converted to /(en|fr|de)/(.*) so will not match the top-level
// `/` or `/fr` routes like /:path* would
source: '/(.*)',
destination: '/another',
permanent: false,
},
] ]
}, },
} }
......
...@@ -244,6 +244,12 @@ module.exports = { ...@@ -244,6 +244,12 @@ module.exports = {
destination: '/en/another', destination: '/en/another',
locale: false, locale: false,
}, },
{
// this gets converted to /(en|fr|de)/(.*) so will not match the top-level
// `/` or `/fr` routes like /:path* would
source: '/(.*)',
destination: '/another',
},
] ]
}, },
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment