diff --git a/docs/advanced-features/custom-error-page.md b/docs/advanced-features/custom-error-page.md index 828ecf789a236..24851e8df4014 100644 --- a/docs/advanced-features/custom-error-page.md +++ b/docs/advanced-features/custom-error-page.md @@ -2,9 +2,30 @@ description: Override and extend the built-in Error page to handle custom errors. --- -# Custom Error Page +## 404 Page -**404** or **500** errors are handled both client-side and server-side by the `Error` component. If you wish to override it, define the file `pages/_error.js` and add the following code: +A 404 page may be accessed very often. Server-rendering an error page for every visit increases the load of the Next.js server. This can result in increased costs and slow experiences. + +To avoid the above pitfalls, Next.js provides a static 404 page by default without having to add any additional files. + +### Customizing The 404 Page + +To create a custom 404 page you can create a `pages/404.js` file. This file is statically generated at build time. + +```jsx +// pages/404.js +export default function Custom404() { + return