i18n: fallback instead of 404
We use Nuxt 3 with the i18n module. Most pages have 10 locales, but the homepage should only “support” 5 (de, en, es, it, fr).
What we want:
- URLs like /nl/... (and other non-supported prefixes) should not 404.
- The homepage should still be reachable under all 10 prefixes, but render English content when the prefix isn’t one of the 5 supported ones.
If we use defineI18nRoute({ locales: ['de','en','es','it','fr'] }) then /nl 404s
Is there a recommended way to:
- keep all locale-prefixed routes alive (so no 404 for /nl), and
- force English rendering for the homepage when the current prefix isn’t in the allowed list?
What we want:
- URLs like /nl/... (and other non-supported prefixes) should not 404.
- The homepage should still be reachable under all 10 prefixes, but render English content when the prefix isn’t one of the 5 supported ones.
If we use defineI18nRoute({ locales: ['de','en','es','it','fr'] }) then /nl 404s
Is there a recommended way to:
- keep all locale-prefixed routes alive (so no 404 for /nl), and
- force English rendering for the homepage when the current prefix isn’t in the allowed list?
