next.config redirects run before rendering and return 308 for permanent rules, so old URLs keep their signals without shipping JavaScript. Move server-side redirect maps into redirects(), mark permanent changes permanent, scope rules with has and missing, and keep temporary campaigns separate. Verify with curl that each old path returns one hop and the expected status.
The extended brief explains when this works, when it does not, and the trade-offs. Join the waitlist and it unlocks for every tip when sign-in opens; MCP access is the paid part.
A list of old paths and their canonical destinations
How to apply it
Collect the current redirect map
List every old URL that still receives traffic or links, with its destination, from the CMS, middleware, server config and analytics landing pages.
Check: The list has one destination per source path and marks which moves are permanent.
Declare rules in next.config
Add an async redirects() export returning source, destination and permanent for each mapping. Use :path parameters for pattern rules and has or missing for scoped cases.
Check: next.config contains the redirects export and the build completes without a redirect error.
Remove overlapping handlers
Delete duplicate rules from middleware or hosting config so one path is handled once. Keep client-side navigation redirects out of the crawler path.
Check: Only one layer defines each source path in the repository.
Test status and hop count
After deploy, request each old path with curl -sI and follow the chain. Confirm a single hop to a 200 destination with the expected 308 or 307 status.
Check: curl -sI your production domain/<old-path> shows one location header and the destination returns 200.
Verify indexing with URL Inspection — URL Inspection shows the indexed version Google holds for one URL: crawl time, selected canonical, status code and blocked resources.
Canonicalize duplicate URLs — Duplicate URLs split signals across protocol, host, slash and parameter variants.
Make JavaScript content crawlable — Google renders JavaScript, but rendering costs time and AI retrieval systems often read raw HTML.