Configure URL redirection

更新时间:
复制 MD 格式

You can configure URL redirection to forcibly redirect HTTP requests from a client to a point of presence (POP) to HTTPS for greater security.

Use cases

For an accelerated domain name that is configured with an SSL certificate, you can configure URL redirection. By default, this feature uses a 301 redirect to force HTTP requests from clients to the CDN node to be redirected to HTTPS. HTTPS requests are more secure.

$ curl http://xxx/' -i
HTTP/1.1 301 Moved Permanently
Server: Tengine
Date: Mon, 03 Jun 2019 13:26:01 GMT
Content-Type: text/html
Content-Length: 278
Connection: keep-alive
Location: https://xxx/
Via: cache2.cn201[,0]
Timing-Allow-Origin: *
EagleId: 2a786b0215595683612635433e
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<h1>301 Moved Permanently</h1>
<p>The requested resource has been assigned a new permanent URI.</p>
&lt;hr/>Powered by Tengine</body>
</html>

By default, URL redirection uses the HTTP 301 status code. To use the HTTP 308 status code, submit a ticket. See Contact us for instructions.

Status code

Description

Behavior

Use case

301

Moved Permanently

GET requests remain unchanged. Requests that use other methods may be changed to GET.

Website refactoring.

308

Permanent Redirect

The request method and message body remain unchanged.

Website refactoring. This redirect is suitable for requests that use methods other than GET.

Prerequisites

Before you configure URL redirection, ensure that you have successfully configured an SSL certificate. For more information, see HTTPS secure acceleration.

Procedure

  1. Log on to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, choose Configuration Management > CDN Configuration > Domain Names.

  3. For the desired domain name, click Configure in the Actions column.

  4. Click the HTTPS tab. In the Forced Redirection section, click Modify.

  5. Set the Redirection type. The following table describes the options.

    Redirection type

    Description

    Default

    Supports both HTTP and HTTPS requests.

    HTTPS -> HTTP

    Redirects HTTPS requests to HTTP.

    HTTP -> HTTPS

    Redirects HTTP requests to HTTPS to ensure secure access.

  6. Click OK to complete the configuration.