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

Selectively disable redirects to prefixless for default locale routes with prefix_and_default strategy #1401

Closed
eatyrghost opened this issue Feb 17, 2022 · 7 comments

Comments

@eatyrghost
Copy link

Problem
We are using the prefix_and_default strategy with a default locale set to en-us.

If we visit a route with the default locale as the prefix, e.g. /en-us/about-us, we are redirected to the prefixless route, /about-us. This is acceptable for most of our pages.

In a handful of cases, we don't want to redirect - we want to specifically use the /en-us prefix.

Desired Solution
There might be two ways we could configure this.

  1. A new property on the page component:
export default {
    disableDefaultRedirect: true
};
  1. A configuration that accepts a boolean or an array of prefixless paths:
// Applies to all routes
i18n: {
    disableDefaultRedirect: true
}

// Applies to /about-us and /products only
i18n: {
    disableDefaultRedirect: [
        '/about-us',
        '/products'
    ]
}
@jeiksegovia
Copy link

That seems very useful

@stale
Copy link

stale bot commented Apr 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 19, 2022
@stale stale bot closed this as completed Apr 28, 2022
@jeiksegovia
Copy link

This feature is still relevant....

@jeiksegovia
Copy link

nice!!

@DanielHefti
Copy link

I'm looking for this feature as well!

@julioglobal100
Copy link

we need this! thanks

@BobbieGoede
Copy link
Collaborator

Closing this as v7 is not being actively worked on (critical hotfixes only), if this still applies to v8 and later please open a new issue!

@BobbieGoede BobbieGoede closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants