> For the complete documentation index, see [llms.txt](https://clients.medianova.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://clients.medianova.com/products/security/always-use-https.md).

# Always Use HTTPS

Configure Always Use HTTPS to redirect HTTP requests to HTTPS using a permanent or temporary redirect.

Redirect HTTP requests to HTTPS to ensure that content is delivered over an encrypted connection.

**Always Use HTTPS** redirects requests received over HTTP to the HTTPS version of the same URL. You can configure the redirect to use either a permanent (`301`) or temporary (`302`) HTTP status code.

{% hint style="info" %}
Ensure that a valid SSL certificate is configured for the CDN Resource before enabling Always Use HTTPS. Otherwise, redirected requests may fail because the HTTPS connection cannot be established correctly.
{% endhint %}

## Configure Always Use HTTPS

{% stepper %}
{% step %}

### Open Security

Open your CDN Resource and select **Security**.
{% endstep %}

{% step %}

### Enable Always Use HTTPS

Turn on **Always Use HTTPS**.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2FFIFpxoOJQGy9UGuC4xBW%2Fimage.png?alt=media&amp;token=ddb6c9b1-b37e-4c72-931e-77f80c9d48a6" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Select the Redirect Code

Under **Redirect code**, select the HTTP status code used for the redirect:

* **301** — Permanent redirect. Recommended for production environments and SEO.
* **302** — Temporary redirect. Use when HTTPS enforcement may change in the future.
  {% endstep %}

{% step %}

### Save the Configuration

Select **Save** in the pending changes bar.

Review the pending changes and confirm the configuration.
{% endstep %}
{% endstepper %}

After the configuration is saved, HTTP requests are redirected to HTTPS using the selected redirect code.

## Behavior

When Always Use HTTPS is enabled:

* HTTP requests are redirected to the HTTPS version of the same URL.
* Request paths and query strings are preserved during the redirect.
* Existing HTTPS requests are not redirected.
* Redirected requests return the configured `301` or `302` status code.
* HTTPS delivery requires a valid SSL certificate for the CDN Resource.

## Redirect Codes

The redirect code determines whether clients should treat the HTTPS destination as permanent or temporary.

<table data-header-hidden><thead><tr><th width="145.199951171875"></th><th width="124.800048828125"></th><th></th></tr></thead><tbody><tr><td>Redirect Code</td><td>Type</td><td>Use</td></tr><tr><td><code>301</code></td><td>Permanent</td><td>Use when HTTP-to-HTTPS redirection is intended to remain in place.</td></tr><tr><td><code>302</code></td><td>Temporary</td><td>Use when HTTPS enforcement may change in the future.</td></tr></tbody></table>

For more information about HTTP status codes, see [HTTP Response Codes](/getting-started/concepts/http-response-codes.md)

## Related Concepts

* [SSL/TLS Encryption](/products/security/ssl-tls-encryption.md)
* [CNAME & SSL](/products/performance-cdn/static-content-delivery/advanced-configuration/cname-and-ssl.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://clients.medianova.com/products/security/always-use-https.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
