How to force HTTPS (redirect HTTP to HTTPS) and enable HSTS
You do not need a rule to force HTTPS. As soon as a website has a valid certificate (status Secured on SSL/TLS), every visit to http:// is redirected permanently (301) to the same address with https://.
How the automatic redirect works
- It starts within a minute after the certificate is issued.
- It applies to the domain,
wwwand aliases covered by the certificate. - Only
/.well-known/acme-challenge/stays reachable over HTTP, so certificates can renew. - No
.htaccessrule is needed. Remove old HTTPS rules from.htaccessif you see redirect loops.
Turn on HSTS (optional)
HSTS tells browsers to always use HTTPS for your website, even if someone types http://. Turn it on only when the site works fully over HTTPS.
- Log in to the control panel (
https://your-server:2083). - Open Access Control (section Domains) and scroll to Protection.
- Next to your website, find HTTPS not enforced in browsers and click Turn on.
- Confirm the message
Browsers will refuse to open this site without HTTPS for a year, even if the certificate is removed. Continue? - The message Saved. appears and the line shows HTTPS enforced in browsers.
The HSTS option is shown only for websites that already have a certificate.
Good to know
- To turn HSTS off, click Turn off on the same line. Browsers that visited the site keep HTTPS until the year has passed.
- Behind Cloudflare, you can also click Always use HTTPS on the Cloudflare page.
- Pages that load images or scripts with
http://addresses show a "not secure" or "mixed content" warning even over HTTPS. Change those addresses tohttps://in your website.
Common questions
My site still opens with http://.
Check SSL/TLS: the redirect starts only when the status is Secured.
Thank you — this helps us improve the article.
Still stuck?
Ask the AI about your exact situation — it answers from this knowledge base — or contact us.
Related articles
- Free SSL certificates (AutoSSL): how they work
Every website gets a free Let's Encrypt certificate automatically. Learn when it is issued, which names it covers, how renewal works and what it needs.
- Website shows "too many redirects" (ERR_TOO_MANY_REDIRECTS)
Fix a redirect loop after enabling SSL or Cloudflare: Cloudflare Flexible mode, a redirect added in the panel, or the site's own address setting.
- How to redirect a domain or page (301 or 302 redirect)
Send visitors of a page or a whole website to another address with a permanent (301) or temporary (302) redirect, optionally keeping the rest of the path.