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
Redirect Mode
Mode of redirecting the error code page to a new page. The options are 301 and 302.
301
Destination URL
New page to which the error code page is redirected. The value must start with http:// or https://.
https://example.com/error404.html
- Configure the parameters and click OK.
Example
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