# Redirects

Site redirects have been available since version 0.14.0. A matching GET or HEAD is answered before auth and the file cache. The request query is kept on `Location`. POST is 405. Only one rule runs per request. Chains are not followed in that request.

```toml
[[redirects]]
from = "/our-firm"
to = "/#our-firm"
status = 301
```

`from` is a site path. `to` is one absolute site path (`/…`), not a scheme URL. `status` defaults to 301. Allowed statuses are 301, 302, 307, and 308.

A destination may include one `#fragment`. That behavior appeared in version 0.15.0. The query is placed before the fragment, so `GET /our-firm?x=1` with `to = "/#our-firm"` returns `Location: /?x=1#our-firm`.

Benson refuses to start when a rule is invalid. The process prints the reason and exits. A rule is invalid when it is a self-redirect, participates in a cycle, repeats a source, uses any other status, puts `?` or a backslash in `to`, or uses an empty or repeated fragment. A destination that is not a page yet is allowed.

These rules are not `[auth.role_redirects]` and they are not a form `success_redirect` or `failure_redirect`.

