应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案、点播分发、直播分发、移动加速、网页加速、下载分发、全站加速
查看内部重定向配置
单用户调用频率:300/5min
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
domain-name | String | 是 | 需要查询配置的域名或域名id |
参数名称 | 类型 | 描述 |
---|---|---|
domain-id | String | 需要查询配置的域名id |
domain-name | String | 需要查询配置的域名 |
rewrite-rule-settings | List | |
data-id | String | 添加grid类型标识,表示客户多组配置时,具体某组配置;data-id重复,已入参同个id最后一组为准生效 |
path-pattern | String | url匹配模式,支持正则, .*:匹配所有文件 客户入参参考:.* 对于匹配到的URL进行内容重定向 |
except-path-pattern | String | 例外的url匹配模式,某些URL除外:如abc.jpg,不做内容重定向 客户入参参考:^https?://[^/]+/.*\.m3u8 |
custom-pattern | String | 匹配条件:指定常用类型,可选值为all或homepage 1、all:全部文件 2、homepage:首页 |
directory | String | 目录 |
file-type | String | 匹配条件:文件类型,多个请以英文;分隔,可选值:gif png bmp jpeg jpg html htm shtml mp3 wma flv mp4 wmv zip exe rar css txt ico js swf m3u8 xml f4m bootstarp ts |
ignore-letter-case | String | 忽略大小写,可选值为true或false,true表示忽略大小写;false表示不忽略大小写;
新增配置项时,不传默认为 true
如果客户传了空值:如 |
publish-type | String | 改写内容的生成位置。可输入值为:Cache表示节点; 暂不支持其他入参格式 |
priority | Number | 表示客户多组重定向内容的优先执行顺序。数字越大,优先级越高。 新增配置项时,不传默认为 10 |
before-value | String | 配置项:旧url 表示改写前的协议方式(即需要改写的对象),如:^https://([^/]+/.*) |
after-value | String | 配置项:新url 表示改写后的协议方式,如:http://$1 |
rewrite-type | String | 重定向类型;支持入参: before:防盗链之前 after:防盗链之后 |
request-header | String | 匹配条件:请求头 |
exception-request-header | String | 匹配条件:例外的请求头 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
NoSuchDomain | The specified domain does not exist. | 404 | 域名不存在 |
CustomerNoOwnDomain | customer not own domain name[xxx] | 400 | 客户没有该域名 |
WRONG_OPERATOR | Operator [$operator] not exist. | 400 | 操作员不存在 |
WRONG_CUSTOMER_NAME | Wrong customer name. | 400 | 客户名称错误 |
WRONG_CUSTOMER_ID | Wrong customer id. | 400 | 客户ID错误 |
#!/bin/bash username="example_username" apiKey="example_apiKey" date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"` password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64` curl -i --url "https://open.chinanetcenter.com/api/config/InnerRedirect/a1.example.com" \ -X "GET" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" -H "Content-Type:application/json"
HTTP/1.1 202 Accepted Date: Fri, 17 May 2017 06:33:26 GMT Content-Type: application/json;charset=utf-8 x-cnc-request-id:c54cbbb4-19fe-407a-930c-3988b62ed2fd { "domain-id":"3797820", "domain-name":"www.web.1558604466417332.com", "rewrite-rule-settings":[ { "after-value":"https://$1", "before-value":"^http://([^/]+/.*)", "data-id":31506537, "except-path-pattern":"^https?://[^/]+/.*.m3u8", "ignore-letter-case":"true", "path-pattern":".*", "priority":"10", "publish-type":"Cache", "rewrite-type":"before" }, { "after-value":"https", "before-value":"http", "data-id":31506539, "except-path-pattern":"^https?://[^/]+/.*.m3u8", "ignore-letter-case":"true", "path-pattern":".*", "priority":"9", "publish-type":"Cache", "rewrite-type":"before" } ] }