# HTTP Redirection to HTTPS

#### Scenarios

HTTPS is an extension of HTTP. HTTPS encrypts data between a web server and a browser.

If you enable redirection, all HTTP requests to your website are transmitted over HTTPS connections to improve service security.

HTTP requests are forwarded to the HTTPS listener as HTTPS requests, which are then routed to backend servers over HTTP.

#### Prerequisites

- An HTTPS listener has been added.
- An HTTP listener has been added.

#### Creating a Redirect

1. Log in to the management console.
2. In the upper left corner of the page, click and select the desired region and project.
3. Hover on in the upper left corner to display Service List and choose Network > Elastic Load Balancing.
4. Locate the load balancer and click its name.
5. Click Listeners, locate the HTTP listener, and click its name.
6. Click Redirects and then Create on the right.

   Table 1 Parameters for configuring redirection
   Parameter | Description | Example Value
   --- | --- | ---
   Name | Specifies the redirect name. | redirect-g8h9
   Redirected To | Specifies the HTTPS listener to which requests are redirected. | N/A
   Description | Provides supplementary information about the redirect. | N/A

7. Click OK.
   - If you create a redirect for an HTTP listener, its settings will not take effect except access control.
   - If you create a redirect for an HTTP listener, the load balancer will return HTTP 301 Move Permanently to the clients.

#### Modifying a Redirect

1. Log in to the management console.
2. In the upper left corner of the page, click and select the desired region and project.
3. Hover on in the upper left corner to display Service List and choose Network > Elastic Load Balancing.
4. Locate the load balancer and click its name.
5. Click Listeners, locate the HTTP listener, and click its name.
6. Click Redirects, locate the redirect, and click Modify in the Operation column.
7. In the Modify Redirect dialog box, modify the redirect name or description, or select another listener, and click OK.

#### Deleting a Redirect

1. Log in to the management console.
2. In the upper left corner of the page, click and select the desired region and project.
3. Hover on in the upper left corner to display Service List and choose Network > Elastic Load Balancing.
4. Locate the load balancer and click its name.
5. Click Listeners, locate the listener, and click its name.
6. Click Redirects, locate the redirect, and click Delete in the Operation column.
7. In the Delete Redirect dialog box, click Yes.

Parent topic: Advanced Features of HTTP/HTTPS Listeners