Redirects

Keep old URLs working when pages move.

Redirects

When you rename or reorganize pages, old links shouldn't break. Add redirects to docs.json and the platform serves real HTTP redirects at the edge — before anything else runs.

{
  "redirects": [
    { "source": "/guides/:slug*", "destination": "/learn/guides/:slug*" },
    { "source": "/api", "destination": "/learn/api-reference" }
  ]
}
FieldRequiredNotes
sourceYesThe old path to match (must start with /)
destinationYesWhere to send it
permanenttrue (default) → 308; false → 307

Permanent vs temporary

A permanent redirect (308, the default) tells search engines the move is final and transfers ranking to the destination. Use permanent: false (307) for temporary reroutes — a page under maintenance, an A/B test:

{ "source": "/beta", "destination": "/", "permanent": false }

Wildcards

Match a whole subtree with :name* and reuse the captured part in the destination:

{ "source": "/old-docs/:slug*", "destination": "/docs/:slug*" }

/old-docs/billing/invoices/docs/billing/invoices.

Keep redirects tidy — point them at the final destination rather than chaining one redirect into another, and never let two redirects point at each other.