Skip to main content
TLSHigh PriorityFree

HTTP to HTTPS Redirect

Updated November 2026·SecScanner Team

Redirecting HTTP requests to HTTPS ensures users always connect securely, even if they type HTTP URLs.

18% of the 101 most-visited sites we scan fail this check. See the full data.

Results in 1–3 minutes · Free · No signup required

Want the result for your own site? Free SSL Checker — paste your domain, get the report.

Why It Matters

Users often type domains without https://. Without redirects, they'd connect insecurely. The first request before redirect is still vulnerable to interception.

How We Check

We verify that HTTP requests are properly redirected to HTTPS with 301 permanent redirects.

Good vs Bad Values

Good and bad values for HTTP to HTTPS Redirect
ValueVerdictWhy
HTTP/1.1 301 Moved Permanently, Location: https://example.com/pricingGoodA permanent redirect to the same host and the same path. Browsers and search engines cache it and deep links keep working.
HTTP/1.1 308 Permanent Redirect, Location: https://example.com/pricingGoodThe method-preserving permanent redirect from RFC 9110. Equivalent to 301 for a normal page load, and the scan accepts it.
301 from http://example.com to https://www.example.comGoodA move between the bare domain and its www variant is allowed. The check only flags a redirect to an unrelated host.
Port 80 refuses the connection (ECONNREFUSED)GoodNothing listens on HTTP at all, so nothing can be intercepted. The check counts this as a pass, although visitors who type the bare domain may see an error instead of your site.
HTTP/1.1 302 Found, Location: https://example.com/WeakIt lands on HTTPS, but a temporary redirect tells browsers and crawlers not to remember it, so every first request still starts on HTTP.
HTTP/1.1 307 Temporary Redirect to the HTTPS URLWeakSame problem as 302: it works for the visitor but is never cached as a permanent move. Use 301 or 308.
HTTP/1.1 200 OK on http://example.comBadThe site answers over plain HTTP without redirecting. Cookies and form data typed on that page travel in clear text.
301 to http://www.example.com/ and then a second redirect to HTTPSBadAn extra HTTP hop. The first request is exposed, and an attacker on the path can answer the hop with their own response.
Every HTTP URL redirects to https://example.com/ (homepage)BadThe path is dropped, so old links and bookmarks to deep pages land on the homepage.

How to Fix

Configure your server to redirect all HTTP traffic to HTTPS. Use 301 redirects. Combine with HSTS for complete protection.

Nginx — a dedicated port-80 server block. It keeps the host and the full request URI, and leaves the ACME challenge path open for Let's Encrypt HTTP-01 renewals:

server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;

    location /.well-known/acme-challenge/ {
        root /var/www/letsencrypt;
    }

    location / {
        return 301 https://$host$request_uri;
    }
}

Apache — a virtual host on port 80 that does nothing except redirect:

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    Redirect permanent / https://example.com/
</VirtualHost>

Redirect permanent appends the rest of the path to the target, so /pricing becomes https://example.com/pricing. Caddy redirects HTTP to HTTPS on its own for any site with a hostname. Cloudflare: SSL/TLS → Edge Certificates → Always Use HTTPS, or a Redirect Rule with the status set to 301. AWS: add a listener on port 80 whose only action is a redirect to HTTPS with status HTTP_301.

Verify the status, the target and the path in one call, and check a deep link too:

curl -sI http://example.com/pricing | head -n 5
# expect: HTTP/1.1 301 ... and Location: https://example.com/pricing

Once the redirect is correct on every hostname, add Strict-Transport-Security so returning visitors skip the HTTP request altogether.

Common Mistakes

  • Redirecting at the application layer only. A CDN, load balancer or proxy in front of the app often answers port 80 first, so the redirect has to be configured where the request actually arrives.
  • Using `return 302` or `Redirect temp` because it was easier to roll back. Permanent redirects are the correct default once HTTPS works.
  • Hard-coding `https://example.com/` as the target instead of keeping `$request_uri`. The redirect works on the homepage and silently breaks every deep link.
  • Sending port 80 to a different host first (for example the www site) and relying on that host to upgrade to HTTPS. Redirect straight to the final HTTPS URL in one hop.
  • Creating a redirect loop behind a proxy. If Cloudflare or a load balancer terminates TLS and talks plain HTTP to the origin, an origin-side “not HTTPS, so redirect” rule fires on every request. Check the forwarded protocol header instead of the connection.
  • Redirecting the whole port 80 site and breaking certificate renewal. HTTP-01 validation needs `/.well-known/acme-challenge/` to answer on port 80; most ACME clients cope with a redirect, but a setup that blocks that path will fail.

Frequently Asked Questions

What is HTTP to HTTPS Redirect?

Redirecting HTTP requests to HTTPS ensures users always connect securely, even if they type HTTP URLs.

Why does HTTP to HTTPS Redirect matter for website security?

Users often type domains without https://. Without redirects, they'd connect insecurely. The first request before redirect is still vulnerable to interception.

How do I fix HTTP to HTTPS Redirect issues?

Configure your server to redirect all HTTP traffic to HTTPS. Use 301 redirects. Combine with HSTS for complete protection.

Related Security Checks

Related Tool

SSL Checker

Run all 10 related checks with our free ssl checker

Check Your Website Now

Run a free security scan to check for HTTP to HTTPS Redirect issues and 61 other security checks.

Scan Your Website Free