-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewriting to the root doesn't work with trailingSlash: never & rewrite to non-existed page/404 issues #11235
Comments
Downgrading to a P3 because this is an experimental feature, and I doubt we have a lot of users using it |
@ematipico also I found that rewriting doesn't change the status code of response, e.g. I want to rewrite from const response = await next('/about');
console.log('return response from rewrite handler', response)
return response; see nodejs in logs: 16:36:49 [watch] src/middleware.ts
return response from rewrite handler Response {
status: 200,
statusText: 'OK',
headers: Headers {
'content-type': 'text/html',
'X-Astro-Route-Type': 'page',
'X-Astro-Reroute': 'no'
},
body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true },
bodyUsed: false,
ok: true,
redirected: false,
type: 'default',
url: ''
}
16:36:49 [404] /en/about 187ms note the |
@ematipico I've tested 4.11 and 404 on rewriting is still the issue Again, the returned http status code is from |
Please create a new one. I haven't seen the issue posted in the comment, sorry about that! |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
/
doesn't work withtrailingSlash: 'never'
config setting/404
doesn't work at all (with or without context (next('/404')
andctx.rewrite('/404')
), might be the same behavior for 500 (?)What's the expected result?
rewriting works fine with
/404
and/
with or without trailingSlash settingLink to Minimal Reproducible Example
https://github.com/vchirikov/astro_issue_01
Participation
The text was updated successfully, but these errors were encountered: