If an error occurs when a user visits a page, the default error page is displayed, such as 404 Not Found. Alibaba Cloud CDN allows you to customize error pages. If errors occur when users visit your web pages, the custom error pages are displayed. This helps you improve user experiences. This topic describes how to create a custom error page.
Alibaba Cloud CDN can redirect requests to custom error pages when errors occur.
- You can customize error pages for the following HTTP status codes: 400, 403, 404, 405, 414, 416, 500, 501, 502, 503, and 504.
- If the delivery of the custom error page is accelerated by Alibaba Cloud CDN, you are charged based on the billing rules of Alibaba Cloud CDN.
- For more information about 404 Not Found pages, see Why does the 404 Not Found page appear?
- Log on to the Alibaba Cloud CDN console.
- In the left-side navigation pane, click Domain Names.
- On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column of the domain name.
- In the management pane of the domain name, click Cache.
- Click the Custom Pages tab.
- Click Customize. In the dialog box that appears, select an HTTP status code and enter a URL.
- Click OK. After the custom page is created, it is displayed on the Custom Pages tab. You can Modify or Delete the page.
error404.htmlis under the root directory of the origin server. Users can visit the page through the accelerated domain name
example.aliyundoc.com. In this case, Alice can use the following settings to customize an error page for the HTTP 404 status code:
- HTTP status code: 404.
- URL: The URL of the custom error page, for example, http://example.aliyundoc.com/error404.html.
- Expected result: When a 404 error occurs, requests are redirected to the custom error page http://example.aliyundoc.com/error404.html.