Skip to content
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

feat: document custom 500 #8495

Merged
merged 16 commits into from
Jun 18, 2024
Merged
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/content/docs/en/basics/astro-pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,20 @@ Files with the `.html` file extension can be placed in the `src/pages/` director

## Custom 404 Error Page

For a custom 404 error page, you can create a `404.astro` or `404.md` file in `/src/pages`.
For a custom 404 error page, you can create a `404.astro` or `404.md` file in `src/pages`.

This will build to a `404.html` page. Most [deploy services](/en/guides/deploy/) will find and use it.

## Custom 500 Error Page

For a custom 500 error page to show for pages in your `hybrid` or `server` project that are [rendered on demand](/en/guides/server-side-rendering/#enable-on-demand-server-rendering), create the file `src/pages/500.astro`. This custom page is not available for prerendered pages.
florian-lefebvre marked this conversation as resolved.
Show resolved Hide resolved

If an error occurs rendering this page, your host's default 500 error page will be shown to your visitor.

<p><Since v="4.10.3" /></p>

During development, if you have a `500.astro`, the error thrown at runtime is logged in your terminal, as opposed to being shown in the error overlay.
florian-lefebvre marked this conversation as resolved.
Show resolved Hide resolved

## Page Partials

<p><Since v="3.4.0" /></p>
Expand Down
Loading