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! +```