# redirects.json

The old shop's URLs.

## `redirects`

array of objects

Exact entries answer first, the patterns after them in the order written.

One old URL: `{ "from": "/damen/schuhe/sneaker.html", "to": "category:women/sneakers" }`, `{ "from": "/index.php", "query": { "cat": "12" }, "to": "category:women/shoes" }`, `{ "from": "/outlet-2019", "status": 410 }` or `{ "pattern": "^/product-category/(.+?)/?$", "url": "/$1" }`.

- `from` (string): The old path, matched as a shop's paths are: ignoring case, a trailing slash and percent-encoding.

- `pattern` (string): Instead of `from`: a regular expression over the path, matched ignoring case, whose groups the `url` may name as `$1`. Patterns run only when no exact entry matched.

- `query` (map of strings): With `from`: parameters the old URL must carry with these values, such as an old shop's category id; the others are ignored.

- `to` (string): The entity whose page it leads to now, such as `category:women/shoes` or `brand:bosch`.

- `url` (string): Instead of `to`: the URL it leads to now, a path such as `/sale` or one that starts with `https://`.

- `status` (integer): `301` by default; `308`, `302` and `307` are allowed, and `410` for a URL removed on purpose, which has no target.
  
  - `301`: `301` by default; `308`, `302` and `307` are allowed, and `410` for a URL removed on purpose, which has no target.
  
  - `302`: `301` by default; `308`, `302` and `307` are allowed, and `410` for a URL removed on purpose, which has no target.
  
  - `307`: `301` by default; `308`, `302` and `307` are allowed, and `410` for a URL removed on purpose, which has no target.
  
  - `308`: `301` by default; `308`, `302` and `307` are allowed, and `410` for a URL removed on purpose, which has no target.
  
  - `410`: `301` by default; `308`, `302` and `307` are allowed, and `410` for a URL removed on purpose, which has no target.

## `$schema`

string

The JSON Schema an editor checks this file against; kept as written.

**Guide:** [redirects.json](/docs/urls#redirectsjson)
