Skip to main content

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

ParameterTypeRequiredDescription
serviceIdIntegerMandatoryThe unique identifier of the service.

Response

Response Body

ParameterTypeDescription
ArrayArray of Redirection Control object.

Object: Redirection Control

ParameterTypeDescription
policyNameStringName of the redirection policy.
matchUrlPathObjectURL path matching configuration that determines which requests the rule applies to. See Match Url Path for details.
matchQueryStringObjectQuery-string matching configuration used to refine which requests the rule applies to. See Match Query String for details.
redirectDestinationStringThe destination URL to redirect to when the policy matches.
httpCodeIntegerHTTP status code for the redirect. Supported values: 301, 302.
priorityIntegerPriority weight for the rule. Rules with a higher weight take precedence. Must be a positive integer.
enabledBooleanWhether the policy is active. Default is true.
Object: Match Url Path
ParameterTypeDescription
operatorStringDefines how to match the URL path. Supported values: prefix, regex, equals, suffix.
patternsArrayList of patterns to match against the URL path.
Object: Match Query String
ParameterTypeDescription
operatorStringDefines how to match the query string. Supported values: prefix, regex, equals, suffix.
patternsArrayList of patterns to match against the query string.

Status Codes, Error Codes and Error Messages

Status CodeError CodeError Message
400Request.BadRequestBad request.
400InvalidCustomer.IdEmptyCustomer ID cannot be empty or invalid.
400InvalidService.IdIncorrectService ID is empty or invalid.
400InvalidService.IdPermissionService 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
}