Move a page
redirectFrom in the frontmatter, turned into route rules under every prefix.
A moved page is the one broken link a documentation site creates for itself. Put the old URL in the frontmatter of the new page, and the redirect ships in the same commit as the move.
Steps
- Move the file and rename it as you meant to.
- List the old paths on the page itself, without any prefix:
--- title: Deploy a site description: Where a duxt site can run. redirectFrom: - /getting-started/deploy - /deployment --- - Rebuild. The build turns each entry into route rules — under every repository, version and locale prefix the page is served at.
- Check one of them, prefix included, in the built site.
Why the frontmatter is the right place
The fix has always lived outside the site: an nginx rule, a Netlify
_redirects file, a Cloudflare list — written by whoever deploys the site and
never by whoever moved the page. And only the layer can solve it once, because
only the resolved manifest knows which prefixes exist; a consumer writing the
rules by hand would have to rediscover the whole scheme per page.
The numeric prefix is stripped from the URL, so renaming 3.guides/ to
4.guides/ moves nothing. Only the part after the dot is the URL.
Checklist
- Every old path is listed, written without a prefix
- The build reports no broken internal link
- An old URL redirects under the version prefix too, not just bare
- Nothing was added to the web server's configuration