nuxt-i18n: 6.13.10
nuxt: 2.14.3
nuxt-comunity/redirect-module: 0.3.1
redirect: [
{
from: "^(\\/[^\\?]*[^\\/])(\\?.*)?$",
to: (from, req) => {
return "$1/$2";
}
}
]
i18n: {
parsePages: false,
lazy: true,
locales: [
{
territory: "US",
name: "English",
code: "en",
iso: "en",
file: "en.json"
},
{
territory: "ES",
name: "Espa帽ol",
code: "es",
iso: "es",
file: "es.json"
}
],
detectBrowserLanguage: false,
vueI18n: {
fallbackLocale: "en"
},
vuex: {
syncLocale: true,
syncMessages: true
},
defaultLocale: "en",
langDir: "locales/",
seo: false
}
Go to path /foo (or any other page that not existing)
404 erorr
I have a small question about nuxt-i18n and nuxt-redirect modules. I think that it's issue, but i am not sure. I have updated the sandbox for reproduce. If you will try to get access to path /foo (or any other page that not existing) with current version of nuxt-i18n package (6.13.10) it will Too many requests error. But with version of package 6.12.0 is it works fine. What's really happening: every non-existent standard language page now has an error Too many requests instead of 404, when we are using trailing slash at the end as default.
nuxt-i18n tries to be smarter itself about redirecting to the correct path.
Do you see any issues or wrong paths with redirect module disabled?
If you want to consistently have trailing slashes in your paths then you should consider setting Nuxt option router.trailingSlash: true and then letting Nuxt and nuxt-i18n handle redirection.
(Just that there are some know issues currently with trailingSlash but it might be good enough for you.)
Hi @rchl. Thanks for an explanation. It doesn't work with only router.trailingSlash, but works with router.trailingSlash and nuxtjs/redirect-module.
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.