I want to do three things in my application, but I’m not figuring out how I could do that using Next.js router.
- The default URL of the application should be 'https://localhost:3000/en'
- It should also be possible to have 'https://localhost:3000/es' as a valid URL
- Anything different than '/es' should redirect to '/en'
(This parameter will influence on the displayed language of the application.)
Considering those three points, should I create inside pages folder a new folder called language and put my index.tsx file and all the others routes that I have?
If I do that, what are the rules that I should create on my next.config.js to match with the criteria that I listed above? If not, what could be another approach to solve this?