HTTP to HTTPS Redirect
  • 24 Jun 2024
  • 1 Minute to read
  • PDF

HTTP to HTTPS Redirect

  • PDF

Article summary

Overview

If you want to block your site from being accessed over HTTP, you can configure an HTTP to HTTPS Redirect rule to force the CDN to redirect HTTP requests to HTTPs. The rule configuration also sets the response code.

Configure the Rule

Here, we'll describe how to configure the rule with the Delivery Service Management UI.

API Users may choose to build the site configuration offline.

To configure an HTTP to HTTPs Redirect rule:

  1. Navigate to the Select Rule dialog.

  2. In the Select Rule dialog, choose HTTP to HTTPs Redirect.

  3. Toggle On the HTTP to HTTPS Redirect feature.
    HTTP2HTTPSRedirect.png

  4. From the Redirect HTTP Status Code field, select the relevant code. The status code affects how the client handles the redirect.

    Status CodeDescription
    301Permanent redirect that tells the client the resource is permanently moved to the new HTTPS URL. This is the default status code value.
    302Temporary redirect that tells the client the resource is temporarily located at the new HTTPs URL.
    307Temporary redirect that also ensures that the HTTP method and body remain unchanged in the redirected request. Use this code when it's critical to maintain the original request method and body (such as for POST requests).
    308Permanent redirect that also ensures that the HTTP method and body remain unchanged in the redirected request. Use this code when it's critical to maintain the original request method and body (such as for POST requests).
  5. Choose Add Rule.

SVTA Component: QW.HTTPtoHTTPSRedirect

When you save the configuration version, the QW.HTTPtoHTTPSRedirect component is added to the JSON configuration.

This is a private feature developed by Qwilt. In the JSON format, private features are nested within the MI.PrivateFeaturesList object, in the "generic-metadata-value" "features" field.

This example forces an HTTP to HTTPs redirect with status code 301.

{
	"generic-metadata-type": "MI.PrivateFeatureList",
	"generic-metadata-value": {
		"features": [
			{
				"feature-oid": "Qwilt",
				"feature-type": "QW.HTTPtoHTTPSRedirect",
				"feature-value": {
					"allow-redirect": true,
					"redirect-code": "301"
				}
			}
		]
	}
}


AttributeValid Values
allow-redirecttrue, false
redirect-code301, 302, 307, 308

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.