- 24 Jun 2024
- 1 Minute to read
- Print
- PDF
HTTP to HTTPS Redirect
- Updated on 24 Jun 2024
- 1 Minute to read
- Print
- PDF
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:
In the Select Rule dialog, choose HTTP to HTTPs Redirect.
Toggle On the HTTP to HTTPS Redirect feature.
From the Redirect HTTP Status Code field, select the relevant code. The status code affects how the client handles the redirect.
Status Code Description 301 Permanent redirect that tells the client the resource is permanently moved to the new HTTPS URL. This is the default status code value. 302 Temporary redirect that tells the client the resource is temporarily located at the new HTTPs URL. 307 Temporary 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). 308 Permanent 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). 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"
}
}
]
}
}
Attribute | Valid Values |
---|---|
allow-redirect | true, false |
redirect-code | 301, 302, 307, 308 |