Closed okj579 closed 9 months ago
Thanks for reporting, after some initial debugging it looks like this happens when the 'prefix' is being used. The correct statusCode is being used when using other strategies, will look into this later.
Hi @BobbieGoede Is it possible to change the 302 redirects to a 301 without using rootRedirect
?
We want all our default locale redirects to be 301s.
For example:
https://domain.com/ > https://domain.com/en
https://domain.com/catgeory-page > https://domain.com/en/catgeory-page
@readio I'm not sure if that's configurable at the moment, also not sure if you mean in v7 or v8 (based on your other issue). I suggest opening a separate issue as a feature request or opening a separate discussion if you have questions.
The fix for this issue is included in the latest edge release, I've changed your reproduction with it installed to demonstrate here.
Environment
Linux
v20.11.0
3.9.1
3.10.0
2.8.1
pnpm@8.14.1
-
extends
,app
,i18n
-
-
Reproduction
https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-tdp4cc?file=nuxt.config.ts
To reproduce, open the preview in a new tab and watch Network Devtools while navigating to
/
. It will show a 302 redirect, even though 307 has been configured.Describe the bug
When using
rootRedirect
, thestatusCode
option is ignored (actually overwritten afterwards, I believe) and a302 Found
is returned.Additional context
No response
Logs
No response