From 1ff1173777a050085f50b6ed46d10f11479a3757 Mon Sep 17 00:00:00 2001 From: Artyom Bologov Date: Fri, 7 Aug 2026 12:35:41 +0400 Subject: [PATCH] Pages: Mention splats and domain redirects in _redirects post --- content/codeberg-pages/advanced-usage.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content/codeberg-pages/advanced-usage.md b/content/codeberg-pages/advanced-usage.md index c5f9596..77ac0c0 100644 --- a/content/codeberg-pages/advanced-usage.md +++ b/content/codeberg-pages/advanced-usage.md @@ -69,4 +69,15 @@ Redirects every path under `/articles` to `/posts` while keeping the path. {% endadmonition %} +Redirection with splats might have exclamation mark after the redirect code (`302!`) to redirect all paths, not only those that weren't found. + Example: `/articles/2022/10/12/post-1/` → `/posts/2022/10/12/post-1/` + +#### Domain redirects + +You can use redirects as a way to "canonicalize" one subdomain into another (or into a toplevel domain.) +For that, use double slash and list the full address, likely with splats: + +```text +//www.example.org/* https://example.org/:splat 302! +```