Pages: Mention splats and domain redirects in _redirects post

This commit is contained in:
Artyom Bologov 2026-08-07 12:35:41 +04:00
parent 88ad37d0c5
commit 1ff1173777

View file

@ -69,4 +69,15 @@ Redirects every path under `/articles` to `/posts` while keeping the path.
{% endadmonition %} {% 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/` 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!
```