Next.js 16+ · Option
rewrites
Rewrites map incoming paths to other destinations while keeping the original URL visible. Configure them in next.config.js to route requests internally or proxy them to an external site.
Last updated
- Since
- v9.5.0
Syntax
async rewrites() { return [{ source: string, destination: string }] }In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
redirectsheadersmiddlewarebasePathgetStaticPaths