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

Prerequisites

An HTTPS certificate is configured. For more information, see Configure an SSL certificate.

Scenarios

HTTP and HTTPS force redirect features are applicable to the following scenarios:
  • For accelerated domain names that have SSL certificates configured, you can enable the 301 redirection to redirect HTTP requests to HTTPS. Compared with HTTP, HTTPS provides enhanced protection.
  • For security-insensitive applications, you can enable the 301 redirection to redirect HTTPS requests between clients and DCDN nodes to HTTP.

Procedure

  1. Log on to the DCDN 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 Configure in the Actions column.
  4. In the left-side navigation pane on the details page of the specified domain name, click HTTPS Settings.
  5. In the Force Redirect section, click Modify.
  6. In the Force Redirect dialog box, select a Redirect Type.
    Redirect type Description
    Default Both HTTP and HTTPS requests are supported.
    HTTPS to HTTP Redirects client requests from HTTPS to HTTP.
    HTTP to HTTPS Redirects client requests from HTTP to HTTPS for a secure data transmission.
  7. Click OK.

Example

Redirect Type is set to HTTP to HTTPS in the following example.

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.