Page returns 404 before being redirected in Cloudflare Pages SSG #2970
Unanswered
rayblair06
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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