Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom 404 page not working in nextjs 14?

Tags:

next.js14

Custom 404 page not working on wrong routes in nextjs 14

After creating a custom 404 page and when try with wrong routes, my custom page is not even rendering, did anyone faced this issue before is it because am amature, is there any solution to find out what wrong am I doing!?

like image 346
Abhijith BS Avatar asked Nov 07 '25 06:11

Abhijith BS


1 Answers

You have to create a "not-found.jsx" or "not-found.tsx" file in your app directory so that nextjs renders that file in case the user hits any unsupported route.

You can read about it in depth here: https://nextjs.org/docs/app/api-reference/file-conventions/not-found

like image 63
Adnan Khan Avatar answered Nov 09 '25 09:11

Adnan Khan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!