Custom Error Pages
When an error is reported during user access, an error page is displayed on the user client. You can customize the error page on the CDN console to optimize user experience.
Precautions
- You can customize error pages for status codes 4xx and 5xx.
- If CDN acceleration is enabled for the custom error pages, you will be billed by CDN.
- You cannot customize error pages for domain names with special configurations.
Procedure
-
Log in to Huawei Cloud console. Choose .
The CDN console is displayed.
- In the navigation pane, choose .
- In the domain list, click the target domain name or click Configure in the Operation column.
- Click the Advanced Settings tab.
- In the Custom Error Pages area, click Add.
Figure 1 Customizing an error page
Table 1 Parameter description Parameter
Description
Example
Error Code
Error code (4xx or 5xx) whose error page needs to be customized.
404
Action
Break: CDN redirects requests with the specified error code returned to the destination URL. Once this rule runs, CDN skips all remaining rules.
Redirect: CDN redirects requests with the specified error code returned to the destination URL. Once this rule runs, CDN will run any other matched rules.
Break
Destination URL
When you set Action to Break, CDN uses full path match. Enter only one path, start with a slash (/), and enter up to 512 characters. Example: /errorcode.html
When you set Action to Redirect, start the URL with http:// or https://, enter up to 512 characters, and include the complete domain name and path. Example: http://example.com/errorcode.html
/errorcode.html
Redirect Mode
Required when Action is set to Redirect. Mode of redirecting the error code page to a new page. Select 301 or 302.
301
- Configure the parameters and click OK.
Examples
Image abc.jpg has been deleted from the origin server and the cache on CDN PoPs has expired. When a user accesses https://example.com/abc.jpg, a status code 404 is returned. Assume that you configure the following settings on the CDN console.
Result: When another user accesses https://example.com/abc.jpg, the user will be redirected to https://example.com/error404.html.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot