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: alwaysRedirect does not work with redirectOn 'all' and 'no prefix' #1884

Merged
merged 2 commits into from
Feb 25, 2023

Conversation

borghol
Copy link
Contributor

@borghol borghol commented Feb 23, 2023

πŸ”— Linked issue

#1859

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

When the strategy is set to anything except 'no_prefix' and with alwaysRedirect enabled, redirection only happens on the root path. This change modifies the check when alwaysRedirect is set to check redirectOn strategy before choosing to redirect.

Previously, going to a page like '/about' would not redirect to '/fr/about' because it is not the root. This fix will allow us to redirect correctly so that '/about' and '/ja/about' will redirect to '/fr/about' when using 'all', and redirect '/about' to '/fr/about' when using 'no prefix'

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@borghol
Copy link
Contributor Author

borghol commented Feb 23, 2023

@kazupon I'm not sure but I think the check is stuck. I checked the linked Netlify build and it was completed

Copy link
Collaborator

kazupon commented Feb 24, 2023

Thank you for your contribution!
I’ll check your PR soon.

@kazupon
Copy link
Collaborator

kazupon commented Feb 25, 2023

That's great works!
Thanks!

@kazupon kazupon merged commit afd9ab2 into nuxt-modules:next Feb 25, 2023
@borghol borghol deleted the fix/redirectOn branch February 25, 2023 15:53
DarthGigi pushed a commit to DarthGigi/i18n that referenced this pull request Apr 16, 2024
…x' (nuxt-modules#1884)

* fix always redirect

* fix

---------

Co-authored-by: khaled.borghol <khaled.borghol@abyatonline.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants