max-custom-routes-reached.mdx
title: Max Custom Routes Reached
Why This Error Occurred
The number of combined routes from headers, redirects, and rewrites exceeds 1000. This can impact performance because each request will iterate over all routes to check for a match in the worst case.
Possible Ways to Fix It
- Leverage dynamic routes inside of the
pagesfolder to reduce the number of rewrites needed - Combine headers routes into dynamic matches e.g.
/first-header-route/second-header-route->/(first-header-route$|second-header-route$)
Useful Links
Rendered from the public repository vercel/next.js on GitHub; content belongs to its authors. Cached for up to an hour.