Does next-intl support auto redirect with locale? #1721
Closed
LikeDreamwalker
started this conversation in
Ideas
Replies: 1 comment
-
I solved it by https://next-intl.dev/docs/routing/middleware |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Like user is visiting '/app', which doesn't have the locale, so it would be the best that next-intl will redirect to '/en/app'.
But I am thinking how this should be done. Seems like the only way is match every request in middleware, or we have to declare a config about which kind of routes we should listen to. This can work but seems like a little stupid and not with the file-system routing way in nextjs.
So any best practices? I am trying to reconstruct my middleware, and I think if I check the current request and do the business redirect first, then check and add locale from next-intl is also not cool enough.
Beta Was this translation helpful? Give feedback.
All reactions