Redirects let you map an old page URL to its new destination so that visitors and search engines landing on a moved page are sent to the new one. This avoids broken links after you rename, move, or delete a page.
Create a file named redirects.yaml in your site root (the same directory
as config.php). It is a YAML map from old URL to new URL. Both the
server and the client read this file, so a redirect applies whether the visitor
arrives by direct request (a 301/302 is issued) or by clicking an in-app
link.
# redirects.yaml
/pages/old-about.html: /pages/about.html
That one line means: anyone who visits /pages/old-about.html is sent to
/pages/about.html.
Keys and internal targets are webpath-relative and begin with /. They are
relative to your site root, the same way the rest of the content URLs are.
/posts/2024/some-post.html: /posts/some-post.html
/pages/contact.html: https://example.com/contact/
A target that begins with http:// or https:// is treated as an external
redirect.
A plain string value is a permanent redirect.
/pages/old-about.html: /pages/about.html
Use an object value with a code key for a temporary redirect.
/pages/temp.html: /pages/about.html, 302
Targets containing a URL fragment (#) or other YAML special characters should
be wrapped in quotes:
/old.html: "https://example.com/page#section"
This is a redirect, not a vanity URL.