Alibaba Cloud CDN provides the force redirect feature that can redirect client requests to HTTP or HTTPS.

Prerequisites

An SSL certificate is configured for the domain name. For more information, see Configure an SSL certificate.

Scenarios

You can enable redirection in the following scenarios:
  • Accelerated domain names that have SSL certificates configured: You can enable 301 redirection to redirect HTTP requests between clients and CDN nodes to HTTPS. Compared with HTTP, HTTPS provides reinforced protection.
  • Security-insensitive applications: You can enable 301 redirection to redirect HTTPS requests between clients and CDN nodes to HTTP.

Procedure

  1. Log on to the Alibaba Cloud CDN console.
  2. In the left-side navigation pane, click Domain Names.
  3. 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.
  4. In the management pane of the domain name, click HTTPS.
  5. In the Force Redirect section, click Modify.
  6. In the Force Redirect dialog box, set the Redirect Type parameter.
    Force redirect
    Redirect Type Description
    Default Supports both HTTP and HTTPS requests.
    HTTPS -> HTTP Redirects client requests from HTTPS to HTTP.
    HTTP -> HTTPS Redirects client requests from HTTP to HTTPS to secure data transmission.
  7. Click OK.

Example

In the following example, the Redirect Type parameter is set to HTTP -> HTTPS.

When a client initiates an HTTP request, the server returns a 301 response to redirect the request to the HTTPS version of the web page, as shown in the following figure. Verify the result.