Skip to main content

Get Redirection Rules

Retrieve a list of redirection rules for website accleration domain.

Request

Request-Line

GET /waap/v1.0/services/{serviceId}/redirections HTTP/1.1

Request Parameters

Path Parameters

ParameterTypeRequiredDescription
serviceIdIntegerMandatoryService ID.

Response

Response Body

ParameterTypeDescription
ArrayArray of Redirection Rule.

Object: Redirection Rule

ParameterTypeDescription
ruleIdIntegerRule ID number for redirection.
nameStringRule name for access control.
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.
priorityIntegerPriority weight for the rule. Rules with a higher weight take precedence. The weight must be non-zero.
redirectionURLStringSend an HTTP redirect if this policy matches.
statusCodeIntegerHTTP response code to use if sending an HTTP redirect. Could be "301/302".
enabledBooleanFlag indicating whether the rule is active.
Object: Match Url Path
ParameterTypeDescription
operatorStringDefines how to match the field. Supported values:prefix,regex,equals,suffix.
patternsString[]List of patterns matching the URL path/query string.
Object: Match Query String
ParameterTypeDescription
operatorStringDefines how to match the field. Supported values:prefix,regex,equals,suffix.
patternsString[]List of patterns matching the URL path/query string.

Status Codes, Error Codes and Error Messages

Status CodeError CodeError Message
400ServiceId.InvalidServiceId is empty or invalid.
400Redirection.OperationFailedThe redirection operation failed.
404ServiceId.NotFoundServiceId is not found.

Examples

Get Redirection Rules

Request

GET /waap/v1.0/services/12345/redirections HTTP/1.1

Successful Response Body

[
{
"name": "test",
"priority": 12,
"enabled": true,
"ruleId": 261704,
"matchUrlPath": {
"operator": "prefix",
"patterns": [
"/"
]
},
"redirectionURL": "http://www.example.com/404.html",
"statusCode": 302
},
{
"name": "test",
"priority": 11,
"enabled": true,
"ruleId": 261703,
"matchUrlPath": {
"operator": "prefix",
"patterns": [
"/"
]
},
"matchQueryString": {
"operator": "prefix",
"patterns": [
"name1=1",
"name2=2"
]
},
"redirectionURL": "http://www.example.com/404.html",
"statusCode": 302
}
]