Skip to content

Commit

Permalink
Mention regex route behavior with i18n (#22500)
Browse files Browse the repository at this point in the history
This mentions how locale routes are transformed when `locale: false` is not used to explain why regex routes might not match with i18n. 

Closes: #21507
  • Loading branch information
ijjk committed Feb 24, 2021
1 parent b90b4b5 commit d9bb645
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/api-reference/next.config.js/headers.md
Expand Up @@ -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',
},
],
},
]
},
}
Expand Down
7 changes: 7 additions & 0 deletions docs/api-reference/next.config.js/redirects.md
Expand Up @@ -152,6 +152,13 @@ module.exports = {
locale: 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,
},
]
},
}
Expand Down
6 changes: 6 additions & 0 deletions docs/api-reference/next.config.js/rewrites.md
Expand Up @@ -244,6 +244,12 @@ module.exports = {
destination: '/en/another',
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',
},
]
},
}
Expand Down

0 comments on commit d9bb645

Please sign in to comment.