mirror of
https://codeberg.org/Codeberg/Documentation.git
synced 2026-08-15 14:53:29 -07:00
Pages: Mention splats and domain redirects in _redirects post
This commit is contained in:
parent
88ad37d0c5
commit
1ff1173777
1 changed files with 11 additions and 0 deletions
|
|
@ -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!
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue