Skip to content

Redirects

Send old URLs to new ones — renamed pages across versions, and host-level redirects.

AI-generated · awaiting reviewUpdated

Two mechanisms cover the common cases: renaming a page across versions, and host-level URL redirects. To change only where a sidebar entry links, without a redirect, see external_link.

Renamed pages across versions

When a page’s slug changes between versions, declare the old slug on the new page so the two are linked as the same logical page and a canonical URL is emitted:

---
title: Configuration
previousSlug: config        # was /config in v1, now /reference/configuration
---

previousSlug accepts a string or an array (for renames across several versions). Nimbus also auto-generates redirects from old-version URLs whose slug no longer exists to their current-version sibling.

Host-level redirects

For permanent URL moves, use Astro’s built-in redirects config — Nimbus merges its version redirects with yours, and your hand-written entries win on conflict:

astro.config.tsts
export default defineConfig({
  redirects: {
    "/old-path": "/new-path",
  },
});

On static hosts these compile to redirect files; on Cloudflare and other adapters they become native redirect rules.

When you move a collection to another folder (Collection URLs), redirect its old URLs with one dynamic entry:

astro.config.tsts
export default defineConfig({
  redirects: {
    "/sdk/[...slug]": "/products/sdk/[...slug]",
  },
});

Astro writes a redirect page for each old page URL. It doesn’t redirect the old Markdown and llms.txt URLs, and with a base it can’t redirect the pages either. For those, add a host rule to public/_redirects (Cloudflare or Netlify), with the base in both paths:

public/_redirectstext
/docs/sdk/* /docs/products/sdk/:splat 301

When you move the collection again, point the existing entry at the new folder too; Astro rejects a redirect to a folder no route serves.

Type to search…

↑↓ navigate↵ selectEsc close