Custom Error Page
Answered
Muhammed Khal posted this in #help-forum
I have created a page with 404.tsx but still it's not even showing the page and again I renamed it to not-found.tsx it's working fine but it's continuously reloading and when I change back to 404 then I not even able to see my custom page and still I am seeing default page
Answered by fuma
404 page is now renamed to [
not-found](https://nextjs.org/docs/app/api-reference/file-conventions/not-found), it will keep reloading the page in dev mode. It's an expected behaviour, it won't happen in production mode.24 Replies
404 page is now renamed to [
not-found](https://nextjs.org/docs/app/api-reference/file-conventions/not-found), it will keep reloading the page in dev mode. It's an expected behaviour, it won't happen in production mode.Answer
404.tsx is for
/pages dir and not-found.tsx is for /app dirAlso, I don't sure what do you mean by the "default page".
Currently,
Currently,
default.tsx itself isn't documented. and only used for [Parallel Routes](https://nextjs.org/docs/app/building-your-application/routing/parallel-routes)I see, I thought he is referring to a file named
defaultnot-found will work fine right
And what about the 505 errors?
Correct, you can just rename the file to
not-found, it's the new name in App Router.@Muhammed Khal And what about the 505 errors?
You have to create another file for handling errors, read this: https://nextjs.org/docs/app/building-your-application/routing/error-handling
Where I can get the new version docs. Please
Open the docs, see the sidebar. Isn't there a button with "App Router" or "Pages Router"?
Yes
So error.js will handle the 505 errors
And not-found will handle the 404 page not found
Yes
Yeah thanks
@fuma Open the docs, see the sidebar. Isn't there a button with "App Router" or "Pages Router"?
btw If you are using App Router (the new one), ensure it's "App Router" not "Pages Router"
Yes I’m using the app router
Not the page router
app/then my components
Thanks for the help