webzod
account

Redirect HTTP straight to HTTPS

headers.redirect.insecure_first_hop · effort: minutes

Why it matters

The first redirect from http:// goes to another http:// address, so the visitor's request travels unencrypted twice before reaching https. The name the visitor typed also never gets an HSTS header, which is only honoured over https.

The fix

  1. Make the first redirect from http go to https on the same host, then redirect to the canonical host over https if it differs, for example http://example.com/ to https://example.com/ to https://www.example.com/.
  2. Check every http entry point (apex and www) with curl -sI and confirm the first Location starts with https://.
http
GET / HTTP/1.1
Host: example.com

HTTP/1.1 301 Moved Permanently
Location: https://example.com/

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.