Glossary: Next.js Beyond the Basics
NextResponse
Also written: NextResponse.next, NextResponse.redirect, NextResponse.rewrite
What a proxy returns: next() carries on to the page, redirect(url) sends the browser elsewhere, and rewrite(url) shows another page's content while keeping the address bar.