Skip to content

Unable to find custom 404 page with trailing slash #7616

@HomWang

Description

@HomWang

What version of astro are you using?

v2.8.0

Are you using an SSR adapter? If so, which one?

Node

What package manager are you using?

npm

What operating system are you using?

Mac

What browser are you using?

Chrome

Describe the Bug

When output: "hybrid", accessing a non-existent page, the custom 404 page cannot be found.
Automatically add '/' after the URL
Step:
1.npm run build
2.HOST=0.0.0.0 PORT=3000 node dist/server/entry.mjs
3.localhost:3000/en/test/asd
4.Custom 404 page not found

What's the expected result?

  1. Find the custom 404 page
  2. Remove the trailing slash

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-nhc9gb-malcwc?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P4: importantViolate documented behavior or significantly impacts performance (priority)feat: error pagesRelated to 404 and 500 handling (scope)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions