next.config.js: Redirects | Next.js
Redirects allow you to redirect an incoming request path to a different destination path. Redirects are only available on the Node.js environment and do not affect client-side routing. To use Redirects you can use the redirects key in next.config.js: redirects is an async function that expects an array to be returned holding objects with source, destination, and permanent properties: source is the incoming request path pattern.
https://nextjs.org/docs/api-reference/next.config.js/redirects