[Docs]: Rewrite gets redirected to but #2023
Replies: 2 comments
-
|
You might have seen this at the bottom of the section:
If you need support, maybe you can find some pieces in the discussions that are helpful. The docs are unfortunately not able to cover every use case, I'll move this to a usage question for now … |
Beta Was this translation helpful? Give feedback.
-
|
Hi amannn, thanks for the reply, yes I read that and it is exactly the point of my question, how should I handle a situation where I need a rewrite with "as-needed" and the default language? Ideally it should redirect to the unprefixed version but keeping the rewrite logic as a rewrite and not redirect |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Link to page
https://next-intl.dev/docs/routing/middleware#example-additional-rewrites
Describe the problem
Hi, I read the documentation here https://next-intl.dev/docs/routing/middleware#example-additional-rewrites
but since internally next-intl does a redirect when switching language with the Link component if "as-needed" is used, any rewrite in the switch language scenario gets redirected to...
It breaks also if someone navigates directly to the prefixed version of the page.
Do you have an alternative recommendation on how to handle this case?
Beta Was this translation helpful? Give feedback.
All reactions