On NextJS (deployed in Vercel), by default, the 404 error page is /404
. I need to change it to /errors/404
.
I've tried reading the docs () and even asking to ChatGPT o3-mini-high, and there is no answer at all.
My problem is that my app/website show user-pages on /xxx
, and the app got viral sooner than expected (getnofilter), and somebody registered the "404" username, so now /404
should show the user instead of the error page. Like /brodanoel
(/[username]
).
I'm using NextJS 14, and with the old folder routing (/pages/[username]/index.js
)
Thanks in advance!
PD.: Yes, I already registered the error
user, so I don't have a problem with /error/404
hahaha
On NextJS (deployed in Vercel), by default, the 404 error page is .com/404
. I need to change it to .com/errors/404
.
I've tried reading the docs (https://vercel.com/guides/custom-404-page) and even asking to ChatGPT o3-mini-high, and there is no answer at all.
My problem is that my app/website show user-pages on .com/xxx
, and the app got viral sooner than expected (getnofilter.com), and somebody registered the "404" username, so now .com/404
should show the user instead of the error page. Like .com/brodanoel
(.com/[username]
).
I'm using NextJS 14, and with the old folder routing (/pages/[username]/index.js
)
Thanks in advance!
PD.: Yes, I already registered the error
user, so I don't have a problem with .com/error/404
hahaha
- 1 Are you running the app on Vercel? – grekier Commented Feb 6 at 14:19
- @grekier, yes, sir. – Broda Noel Commented Feb 6 at 18:47
- 1 Then you could have a vercel.json to use another file. See vercel.com/guides/… – grekier Commented Feb 6 at 19:50
1 Answer
Reset to default 0As @grekier mentioned in the comments, the solution is: https://vercel.com/guides/custom-404-page#what-if-i-need-to-name-my-404-file-something-different