Skip to content
Discussion options

You must be logged in to vote

Your current approach is probably fine as long as you make sure there is no real page at /error404.

To make sure error404 doesn't accidentally get used by a real page and cause a problem later on, I would suggest creating a page at pages/error.js for example and using that as an error page to which you can route manually like you are already doing.

You could also create a custom error page. To do this, create 404.js inside your pages directory. You can then customize this page. For errors other than a 404, create a pages/_error.js page. You can find the documentation for this in the Next.js documentation.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ashx404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants