Selectively disable redirects to prefixless for default locale routes with prefix_and_default strategy
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.
- A new property on the page component:
export default {
disableDefaultRedirect: true
};
- 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'
]
}
That seems very useful
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.
This feature is still relevant....
nice!!
I'm looking for this feature as well!
we need this! thanks