Support Library
HTTPS and HTTP-to-HTTPS Redirects
HTTPS encrypts the connection between a visitor’s browser and your website, so nobody in between can read or change the page. A site that still answers on plain http:// should send every visitor straight to the HTTPS version.
The short answer
Serve every page over HTTPS with a valid certificate, and make the plain http:// address answer with a permanent redirect (301 or 308) to the same page on https://. Certificates are free from Let’s Encrypt and are built into most hosting platforms and CDNs, so in most cases this takes minutes, not a project.
- No HTTPS at all means every visitor’s traffic can be read and rewritten by whoever controls the network they are on.
- HTTPS without a redirect means people who type the bare address, or follow an old link, still land on the unencrypted copy.
What the problem looks like
How DNS Panopticon detects it
Security Posture loads your homepage the way a browser would and records whether it ended up on HTTPS. It then sends one extra request to the plain http:// address and checks whether the answer redirects to https://. Both results appear on the Website Application Security card.
| Finding | Severity | When it appears |
|---|---|---|
| Website doesn’t use HTTPS | High | The homepage only loads over plain http. |
| http:// doesn’t redirect to HTTPS | Medium | The site works on HTTPS, but the http:// address serves a page instead of redirecting. |
| Website uses HTTPS / http:// redirects to HTTPS | Pass | Both checks are fine. |
Only the homepage is checked. A site can pass here and still have individual pages or subdomains on plain HTTP, so check the important ones yourself.
How to check it yourself
In a browser, look at the address bar. Chrome, Edge and Firefox show “Not secure” or a crossed-out padlock for plain HTTP pages. To see the redirect, use curl, which ships with Windows 10 and later, macOS and Linux.
| Command | What to look for |
|---|---|
| curl -sI http://example.com | A 301 or 308 status and a Location: https://example.com/ header. A 200 means the http:// page is served directly. |
| curl -sIL http://example.com | Follows every redirect. The last block should be a 200 on an https:// URL. |
| curl -sI https://example.com | A normal answer. An error such as “SSL certificate problem” means the certificate is invalid or expired. |
| openssl s_client -connect example.com:443 -servername example.com | The certificate chain, who issued it, and its validity dates. |
Why it matters
- Eavesdropping. On plain HTTP, everything a visitor sends and receives, including form fields, cookies and the pages they read, crosses the network in readable form.
- Tampering. Hotspots, compromised routers and some ISPs have injected ads, tracking or malware into HTTP pages. HTTPS makes any change detectable, so the browser drops the connection instead of showing altered content.
- Session theft. A login cookie sent over HTTP can be copied and replayed to take over the account.
- Browser warnings. Browsers label HTTP pages “Not secure”, and many features, such as geolocation, service workers and some payment APIs, only work on secure pages.
- Trust and search. Visitors notice the warning, and Google has used HTTPS as a ranking signal since 2014.
The redirect matters because people rarely type https://. Old bookmarks, printed material and links on other sites often use http://. Without a redirect, each of those visits starts unencrypted.
How to fix it
- Get a certificate. Most hosts, CDNs and platforms (Cloudflare, Netlify, GitHub Pages, Squarespace, Shopify, Azure App Service, AWS CloudFront) issue and renew certificates for you once the domain points at them. On your own server, use an ACME client such as Certbot with Let’s Encrypt, which renews automatically.
- Serve the site on port 443 with that certificate, for the bare domain and for www if you use it.
- Redirect all http:// requests with a 301 or 308 to the same host and path on https://. Redirect to the same host first; if you also move between www and the bare domain, do it on HTTPS.
- Fix internal links and canonical tags to use https://, so pages do not bounce through redirects or load mixed content.
- Add HSTS once everything works, so browsers stop trying http:// at all. See HSTS: HTTP Strict Transport Security.
Typical redirect settings:
| Platform | Redirect setting |
|---|---|
| nginx | A server block on port 80 containing return 301 https://$host$request_uri; |
| Apache | In the port 80 virtual host: Redirect permanent / https://example.com/ |
| IIS | The URL Rewrite module with a rule that matches {HTTPS} off and redirects to https://{HTTP_HOST}/{R:1} |
| Cloudflare | SSL/TLS → Edge Certificates → Always Use HTTPS |
| Azure App Service | Configuration → General settings → HTTPS Only |
| AWS CloudFront | Viewer protocol policy: Redirect HTTP to HTTPS |
An nginx example that serves HTTPS and redirects everything else:
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name example.com www.example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
}You can also publish a CAA record that names the certificate authority you use, so other authorities refuse to issue certificates for your domain.
FAQ
Should the redirect be a 301, 302, 307 or 308?
Use a permanent redirect: 301 or 308. Both tell browsers and search engines the move is permanent. 308 also guarantees the request method is kept, which matters only for forms that POST to the http:// address. 302 and 307 are temporary, so search engines keep the http:// URL.
My site has no logins or forms. Does it still need HTTPS?
Yes. HTTPS also stops anyone on the network from changing the page, for example by injecting ads or malware, and browsers label every HTTP page “Not secure” whether or not it has a form.
Is a free Let’s Encrypt certificate as secure as a paid one?
For encryption, yes: browsers treat a valid certificate from any trusted authority the same way. Paid certificates can include organization validation or support contracts, but they do not make the connection stronger.
Will redirecting to HTTPS hurt search rankings?
No. Google treats an HTTP to HTTPS move with permanent redirects as a site move and transfers ranking signals to the HTTPS URLs. Update your sitemap and canonical tags to the https:// addresses as well.
Sources and further reading
- RFC 9110: HTTP Semantics, section 15.4 (Redirection 3xx): what 301, 302, 307 and 308 mean
- RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3
- Let’s Encrypt: Getting Started: free certificates and ACME clients
- MDN: Redirections in HTTP
- OWASP Transport Layer Security Cheat Sheet
- web.dev: Why HTTPS matters
- Chromium Blog: A secure web is here to stay: Chrome marking HTTP pages “Not secure”