Skip to content
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

fix: create proper redirect for non-locale paths #10

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

mvantellingen
Copy link
Member

@mvantellingen mvantellingen commented Jan 22, 2024

When the path didn’t have a locale but the localePrefix was set to always we let next-intl redirect the user to /${defaultLocale}/${path}. On visit we then rewrote that to /${defaultPathLocale}/${path} and redirect the client again.

This makes sure we do the redirect ourselves skipping an extra redirect

@mvantellingen mvantellingen force-pushed the feat/fix-double-redirect branch from f3579de to 35e3f25 Compare January 22, 2024 14:06
When the path didn’t have a locale but the `localePrefix` was set to
`always` we let next-intl redirect the user to
`/${defaultLocale}/${path}`. On visit we then rewrote that to
`/${defaultPathLocale}/${path}` and redirect the client again.

This makes sure we do the redirect ourselves skipping an extra redirect
@mvantellingen mvantellingen force-pushed the feat/fix-double-redirect branch from 35e3f25 to a8b60a5 Compare January 22, 2024 14:07
@mvantellingen mvantellingen requested a review from blurrah January 22, 2024 14:11
@mvantellingen mvantellingen merged commit 667d8c4 into main Jan 22, 2024
4 checks passed
@mvantellingen mvantellingen deleted the feat/fix-double-redirect branch January 22, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant