-
-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewriting the prefixes #549
Comments
I found a a work around, by changing from server components to client components and adding the following in my middleware to make the rewrite config work:
So final solution for anyone who is interested:
next.config.js:
Cant seem to get it to work with server components. |
To make it work with server components I removed the rewrites from the next.config.js file and created them in the middleware like so:
|
Thank you for sharing your workaround! I made a note in #243 about this, the two issues seem to be related and I'm wondering if there could be a shared solution. |
I agree there's a piece missing here currently. I've opened #653 to collect this issue together with similar ones, also to share solutions that can be used today. |
@dellacagna I've updated #653 with a proposal that I think could support your use case. Let me know in the linked issue in case you have feedback or a better idea in mind! |
I'll close this now in favor of #653. This issue is mentioned there and will be taken care of. |
Is your feature request related to a problem? Please describe.
I would like to modify the URL structure of the prefix from a format like /en-GB to /en/UK or /eng.
Describe the solution you'd like
In the middleware I would like to specify my alternate prefixes and map them to the locale, similar like how its done with the domain mapping e.g.
Describe alternatives you've considered
I tried modifying the next.config.js like this:
I also tried by adding the domain middleware:
The text was updated successfully, but these errors were encountered: