You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is a bug or a misconfiguration on our side, but I'm trying to understand how locale redirects are supposed to work with i18n in terms of SSG. We're using Nuxt 3, hosted on Cloudflare Pages, and we pre-render our pages with the locale prefix, so pages are organized as /en/foo/index.html, /es/foo/index.html, etc.
However, pages that don't match the file routing currently return a 404 status code before being redirected to the correct filepath.
For example, with the prefix strategy, accessing /foo initially results in a 404 error before redirecting to /en/foo. This likely occurs because /foo.html doesn't exist; the actual file is /en/foo/index.html via Cloudflare Pages. While i18n on the client side handles the redirection correctly, returning a 404 status code on the initial request can negatively impact our SEO.
We use dynamic urls so manually adding redirects isn't really an option.
Note: We experienced this issue with the prefix_except_default strategy as well, so it isn't exclusive to any specific routing strategy within i18n.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm not sure if this is a bug or a misconfiguration on our side, but I'm trying to understand how locale redirects are supposed to work with i18n in terms of SSG. We're using Nuxt 3, hosted on Cloudflare Pages, and we pre-render our pages with the locale prefix, so pages are organized as
/en/foo/index.html
,/es/foo/index.html
, etc.However, pages that don't match the file routing currently return a
404
status code before being redirected to the correct filepath.For example, with the
prefix
strategy, accessing/foo
initially results in a404
error before redirecting to/en/foo
. This likely occurs because/foo.html
doesn't exist; the actual file is/en/foo/index.html
via Cloudflare Pages. While i18n on the client side handles the redirection correctly, returning a404
status code on the initial request can negatively impact our SEO.We use dynamic urls so manually adding redirects isn't really an option.
Note: We experienced this issue with the
prefix_except_default
strategy as well, so it isn't exclusive to any specific routing strategy within i18n.Beta Was this translation helpful? Give feedback.
All reactions