next.js
next.js copied to clipboard
In NextJS12, rewriting locale paths does not work
Verify canary release
- [X] I verified that the issue exists in Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:36:53 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T8101
Binaries:
Node: 17.7.2
npm: 8.5.2
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.1.5
react: 18.0.0
react-dom: 18.0.0
What browser are you using? (if relevant)
Chrome
How are you deploying your application? (if relevant)
No response
Describe the Bug
In NextJS 11, I could use a rewrite to alias a locale path.
For example, instead of having /en-AU as the path, I could add a rewrite so that /au points to /en-AU. This is a much cleaner experience. This is not available in NextJS12
Expected Behavior
I can create a rewrite so that /au can be used as an alias for /en-AU
To Reproduce
Upgrade to NextJS12. Add locales. Create a rewrite so that the 2 letter country code points to the 5 letter language-Region code
Same problem here