Updated on 2024-08-22 GMT+08:00

Force Redirect

Requests from clients to CDN PoPs can be forcibly redirected to HTTP or HTTPS.

Scenarios

Force redirect to HTTP: If you do not have high security requirements, use 301/302/307 to forcibly redirect all client requests to HTTP.

Force redirect to HTTPS: If you have set a certificate for your domain name on CDN and you pay more attention to security, use 301/302/307 to forcibly redirect all client requests to HTTPS.

Precautions

  • To redirect requests to HTTPS, configure an HTTPS certificate for your domain name first.
  • If you have configured force redirect to HTTPS, disabling the certificate will also disable force redirect to HTTPS.
  • If you have enabled HTTP/2, force redirect to HTTP does not take effect.

Procedure

  1. Log in to Huawei Cloud console. Choose Service List > Content Delivery & Edge Computing > Content Delivery Network.

    The CDN console is displayed.

  2. In the navigation pane, choose Domains.
  3. In the domain list, click the target domain name or click Configure in the Operation column.
  4. Click the HTTPS Settings tab.
  5. Click Edit next to Force Redirect. The Force Redirect dialog box is displayed.
    Figure 1 Force redirect
    Table 1 Parameter description

    Parameter

    Description

    Status

    Whether to enable this function.

    Enabled: Specify whether to redirect requests from clients to HTTP or HTTPS.

    Disabled: Both HTTP and HTTPS requests from clients are supported.

    Protocol

    HTTP: Requests from clients to CDN PoPs are forcibly redirected to HTTP.

    HTTPS: Requests from clients to CDN PoPs are forcibly redirected to HTTPS.

    Redirect Mode

    301

    302

    307

  6. Select a mode and click OK.