Currently we're using the page router's _error.js to handle unmatched URLs in our application. In the app router, we can use not-found.js to handle a 404 HTTP status.
We'll need to create a note-found.js for handling 404.
Problem or idea
As stated above, create a custom not-found error file to handle the application's mismatched URLs.
Solution or next step
Create a not-found.js file to handle 404 in the app folder
Context
Resources: Next.js: not-found.js
Currently we're using the
page
router's_error.js
to handle unmatched URLs in our application. In theapp
router, we can usenot-found.js
to handle a 404 HTTP status.We'll need to create a
note-found.js
for handling 404.Problem or idea
As stated above, create a custom not-found error file to handle the application's mismatched URLs.
Solution or next step
not-found.js
file to handle 404 in theapp
foldershared/Error/Custom404
into the file.