---
title: Redirections syntax
description: The line format for URL redirections — regex matching, status codes, capture groups — and where they are actually written.
updated: 2026-08-16
prev: global-fields
next: site-settings
---

Redirections map old URLs to new ones at request time. They are a settings surface of their own, edited in the back-office — **not** a key inside [`miscellaneous`](/en/docs/site-settings): the API rejects a `redirections` key there outright (422, *"A Settings config can't have a 'redirections' property"*). The value is a block of space-separated **lines**, not a YAML list of objects. One redirection per line.

## Line format

```
matchingUri redirectionUrl redirectionCode
```

| Field | Required | Notes |
|---|---|---|
| `matchingUri` | yes | A regex. If it contains `://` it matches the **full URL** (cross-domain); otherwise it matches the **URI only** (same-host path). |
| `redirectionUrl` | yes | Destination. May reference capture groups from `matchingUri`. |
| `redirectionCode` | no | HTTP status. Default **301**. Allowed: `300`, `301`, `302`, `303`, `307`, `308`. |

- Fields are space-separated; one redirection per line.
- Blank lines and `#` comments are tolerated.
- Capture groups: `(.*)` in `matchingUri` is referenced as `{$1}`, `{$2}`, … in `redirectionUrl`.

## Examples

```
/url1 /url2
/url3 /url4 302
/mypage/[a-z]+ /urlB
/dynamic/url/[0-9]+/[0-9]+/(.*)$ /new/url/{$1} 301
https?://fr.domain.com/contact https://www.domain.com/fr/contact   # absolute dest avoids loops
```

The last line shows a cross-domain match (`://` present) with an absolute destination, which avoids redirect loops.

## Writing redirections

**There is no API write path for redirections.** Measured, not assumed:

- `update-settings-partial` only accepts the collection-shaped configs (`page-types`, `content-types`, `item-set-types`) — no `miscellaneous`, no `redirections`.
- `update-setting` on `miscellaneous` **rejects** a `redirections` key with a 422 validation error.
- No CLI command and no other MCP tool targets them.

Redirections are edited by a human in the back-office. An agent asked to set them up composes the lines — that part it does well — and hands them over to be pasted.

<div class="q-callout q-callout-warn"><i class="fa-solid fa-triangle-exclamation lead"></i>
  <div><b>Line format not yet live-confirmed.</b> The format on this page comes from the platform spec, not from a live read. The storage question <i>is</i> settled (measured above); the runtime behaviour — regex flavour, capture groups, status codes — still awaits verification, and the note below explains why it cannot be settled from a laptop.</div></div>

The screen lives at **Content management → Redirections**, between *Routes* and *Dictionnary*: one numbered text area, a **Save** that applies the whole block. See [Set up redirections](/en/docs/set-up-redirections) for the screenshot and the composing rules.

<div class="q-callout q-callout-warn"><i class="fa-solid fa-triangle-exclamation lead"></i>
  <div><b>Not reproducible on a dev server.</b> Measured: <code>quilium run</code> does <b>not</b> evaluate redirections — a source path that redirects in production answers <b>404</b> locally. Whatever you want to verify about regex flavour, capture groups or status codes has to be verified against the served site.</div></div>

## Related

<div class="q-cards">
  <a class="q-card reco" href="/en/docs/set-up-redirections"><span class="k">Recommended</span><span class="t">Set up redirections</span><span class="d">How-to: compose, place and test a redirection.</span></a>
  <a class="q-card" href="/en/docs/site-settings"><span class="t">Site settings</span><span class="d">What <code>miscellaneous</code> does and does not hold.</span></a>
  <a class="q-card" href="/en/docs/routing-and-urls"><span class="t">Routing and URLs</span><span class="d">How a URL resolves before a redirection is needed.</span></a>
</div>
