Broda Noel
Broda Noel

Reputation: 1960

Vercel NextJS: How can I redefine the route of 404 error page

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

Upvotes: 0

Views: 24

Answers (1)

Broda Noel
Broda Noel

Reputation: 1960

As @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

Upvotes: 0

Related Questions