List Redirection
This API is used to list redirection policies for a website accleration service.
Request
Request-Line
GET /cdn/v1.0/services/{serviceId}/redirections HTTP/1.1
Request Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| serviceId | Integer | Mandatory | The unique identifier of the service. |
Response
Response Body
| Parameter | Type | Description |
|---|---|---|
| Array | Array of Redirection Control object. |
Object: Redirection Control
| Parameter | Type | Description |
|---|---|---|
| policyName | String | Name of the redirection policy. |
| matchUrlPath | Object | URL path matching configuration that determines which requests the rule applies to. See Match Url Path for details. |
| matchQueryString | Object | Query-string matching configuration used to refine which requests the rule applies to. See Match Query String for details. |
| redirectDestination | String | The destination URL to redirect to when the policy matches. |
| httpCode | Integer | HTTP status code for the redirect. Supported values: 301, 302. |
| priority | Integer | Priority weight for the rule. Rules with a higher weight take precedence. Must be a positive integer. |
| enabled | Boolean | Whether the policy is active. Default is true. |
Object: Match Url Path
| Parameter | Type | Description |
|---|---|---|
| operator | String | Defines how to match the URL path. Supported values: prefix, regex, equals, suffix. |
| patterns | Array | List of patterns to match against the URL path. |
Object: Match Query String
| Parameter | Type | Description |
|---|---|---|
| operator | String | Defines how to match the query string. Supported values: prefix, regex, equals, suffix. |
| patterns | Array | List of patterns to match against the query string. |
Status Codes, Error Codes and Error Messages
| Status Code | Error Code | Error Message |
|---|---|---|
| 400 | Request.BadRequest | Bad request. |
| 400 | InvalidCustomer.IdEmpty | Customer ID cannot be empty or invalid. |
| 400 | InvalidService.IdIncorrect | Service ID is empty or invalid. |
| 400 | InvalidService.IdPermission | Service ID cannot be found or unknown. |
Examples
List Redirection
Request
GET /cdn/v1.0/services/226401/redirections HTTP/1.1
#### Successful Response Body
```json
{
"policyName":"redo",
"matchUrlPath": {
"operator": "suffix",
"patterns": [
"/wp-content/web/"
]
},
"priority":1,
"redirectDestination":"www.domain333.com",
"httpCode":302,
"enabled":true
}