> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.butterix.com/llms.txt
> - v0: https://docs.butterix.com/v0/llms.txt

> For the MDX source of any page, append .mdx to the page URL.
> For a complete documentation index, see https://docs.butterix.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.butterix.com/_mcp/server.
> If something on this page is wrong or missing, POST JSON {"page": "<page URL>", "message": "<what is wrong>"} to https://docs.butterix.com/_biti/feedback/agent.

# 404 推荐重定向

`GET /sites/{site}/redirects`

最近 30 天读者访问过、但不存在的地址与推荐的页面，可以合并的整段搬家，以及已经加上的重定向。

Base URL: https://api.butterix.com/v1

Authentication: bearer token in Authorization header or API key in cookie `biti_session`

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `site` | string | yes | 站点 slug 或 id |

## Example request

```bash
curl https://api.butterix.com/v1/sites/acme-payments/redirects \
     -H "Authorization: Bearer <token>"
```

## Responses

### 200

推荐与已加上的重定向

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `suggestions` | list of objects | no |  |
| `suggestions[].path` | string | no |  |
| `suggestions[].count` | integer | no |  |
| `suggestions[].last` | integer | no |  |
| `suggestions[].target` | object | no | 地址最像的页面；没有把握时不给 |
| `suggestions[].target.path` | string | no |  |
| `suggestions[].target.title` | string | no |  |
| `suggestions[].target.score` | number | no |  |
| `groups` | list of objects | no |  |
| `groups[].from` | string | no |  |
| `groups[].to` | string | no |  |
| `groups[].paths` | list of strings | no |  |
| `groups[].count` | integer | no |  |
| `rules` | list of objects | no |  |
| `rules[].from` | string | no |  |
| `rules[].to` | string | no |  |
| `rules[].status` | enum | no | Allowed: `301`, `302`. |
| `rules[].at` | integer | no |  |
| `rules[].active` | boolean | no | 原地址有了页面时为 false，不再跳转 |

### Example response (200)

```json
{
  "suggestions": [
    {
      "path": "/gide",
      "count": 12,
      "last": 1,
      "target": {
        "path": "/guide",
        "title": "string",
        "score": 1.1
      }
    }
  ],
  "groups": [
    {
      "from": "/docs/old/*",
      "to": "/docs/new/:splat",
      "paths": [
        "string"
      ],
      "count": 1
    }
  ],
  "rules": [
    {
      "from": "string",
      "to": "string",
      "status": 301,
      "at": 1,
      "active": true
    }
  ]
}
```
