You can call this operation to customize a page to redirect to when an access error occurs to a CDN domain.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes SetHttpErrorPageConfig

The operation that you want to perform. Set the value to SetHttpErrorPageConfig.

DomainName String Yes www.macaron.org.cn

The name of the CDN domain to set the custom error page for.

ErrorCode String Yes 500

The custom error code.

PageUrl String Yes http%3A%2F%2Fwww.aliyun.com%2Fnotfound%2F

The URL of the custom page to redirect to after an error occurs. It must be a complete path under the CDN domain.

Response parameters

Parameter Type Example Description
RequestId String A32554F3-F478-4B7F-9FA5-2A41ED2F3B2F

The ID of the request.

Examples

Sample requests

http(s)://cdn.aliyuncs.com? Action=SetHttpErrorPageConfig
&DomainName=www.macaron.org.cn
&ErrorCode=500
&PageUrl=http%3A%2F%2Fwww.aliyun.com%2Fnotfound%2F
&<Common request parameters>

Sample success responses

XML format

<SetHttpErrorPageConfigResponse>
	  <RequestId>A32554F3-F478-4B7F-9FA5-2A41ED2F3B2F</RequestId>
</SetHttpErrorPageConfigResponse>

JSON format

{
	"RequestId":"A32554F3-F478-4B7F-9FA5-2A41ED2F3B2F"
}

Error codes

HTTP status code Error code Error message Description
400 MissingParameter The specified value of parameter DomainName can not be empty. The error message returned because the DomainName parameter is not specified.
400 MissingParameter The specified value of parameter ErrorCode can not be empty. The error message returned because the ErrorCode parameter is not specified.
400 MissingParameter The specified value of parameter PageUrl can not be empty. The error message returned because the PageUrl parameter is not specified.
400 InvalidPageUrl.Malformed The specified value of parameter PageUrl is not malformed. The error message returned because the specified PageUrl parameter is invalid.
400 InvalidErrorCode.Malformed The specified value of parameter ErrorCode is not malformed. The error message returned because the specified ErrorCode parameter is invalid.

For more information about error codes, visit API Error Center.