Set301Status
为网站设置 301 永久重定向规则,将指定来源域名跳转到目标 URL。
- 路由:
POST /site - action:
Set301Status
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 Set301Status |
| siteName | 是 | String | 网站域名 |
| srcDomain | 是 | String | 来源域名,必须带 http:// 前缀 |
| toDomain | 是 | String | 目标 URL,必须带 http:// 前缀 |
| type | 是 | String | 重定向类型,1 = 域名重定向 |
相关接口
- Get301Status — 获取当前重定向配置
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 表示操作成功 |
| msg | String | 提示信息 |
示例
请求
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=Set301Status&siteName=testapi.bt.local&srcDomain=http://old.test.com&toDomain=http://testapi.bt.local&type=1
响应
{"status": true, "msg": "操作成功"}