Show headers, follow redirects, check HSTS
curl comes preinstalled on Linux, macOS and Windows (since Windows 10). Choose what you want to check and enter your domain.
Only inserted into the commands in your browser.
All headers · curl · Linux, macOS
-I fetches only the headers (a HEAD request), -s hides the progress meter. The first line gives protocol and status code, followed by one header per line.
curl -sI https://example.comHTTP/2 200
date: Tue, 10 Nov 2026 13:44:14 GMT
content-type: text/html; charset=utf-8
last-modified: Thu, 05 Nov 2026 21:17:41 GMT
alt-svc: h3=":443"; ma=86400All headers · PowerShell · Windows
In PowerShell type curl.exe rather than curl: in Windows PowerShell 5.1 curl is an alias for Invoke-WebRequest and does not understand these options.
curl.exe -sI https://example.comRedirects · curl · Linux, macOS
-L follows every redirect; the filter keeps only status lines and targets. Each HTTP line is one hop: here one jump from http to https, then the page itself.
curl -sIL http://example.com | grep -iE "^(HTTP|location)"HTTP/1.1 301 Moved Permanently
Location: https://example.com/
HTTP/2 200 Redirects · PowerShell · Windows
Select-String plays the part of grep and ignores case by default.
curl.exe -sIL http://example.com | Select-String "^(HTTP|location)"HSTS · curl · Linux, macOS
Shows only the HSTS header. No output means the site does not send one. Check the https address; over http the header has no effect.
curl -sI https://example.com | grep -i strict-transport-securitystrict-transport-security: max-age=31536000; includeSubDomainsHSTS · PowerShell · Windows
The same check on Windows. Empty output means the header is missing.
curl.exe -sI https://example.com | Select-String "strict-transport-security"With HTTP/2 curl prints header names in lower case, with HTTP/1.1 as the server sent them. That is presentation only; header names are case-insensitive. This is why grep always runs with -i here.
What max-age=31536000; includeSubDomains does
The Strict-Transport-Security header (HSTS) tells the browser to reach the domain over HTTPS only. max-age is how many seconds it remembers that: 31536000 seconds are 365 days, and every visit restarts the clock. During that time the browser rewrites any http address of the domain to https by itself and offers no "proceed anyway" on certificate errors.
includeSubDomains extends this to every subdomain, including ones that do not exist yet or are only used internally. So increasing max-age to 31536000 and adding includeSubDomains is a one-year commitment: a subdomain without a valid certificate becomes unreachable for everyone who visited before, and you cannot take it back until the period has run out in their browsers.
Strict-Transport-Security: max-age=31536000; includeSubDomainsOne year plus includeSubDomains is also what the browser preload list requires, together with the preload token. The HSTS guide explains how to raise max-age in safe steps.
Security headers only, and counting redirects
Some servers answer HEAD requests differently from normal ones or reject them with 405. The first line therefore sends a regular GET, discards the body and prints only the headers, filtered to the security-relevant ones. The second counts the redirects and names the destination.
curl -s -o /dev/null -D - https://example.com | grep -iE "^(strict-transport|content-security|x-frame|x-content-type|referrer-policy|permissions-policy)"
curl -sIL -o /dev/null -w "%{num_redirects} redirects, final: %{url_effective} (%{http_code})\n" http://example.comThe second line answers with something like "1 redirects, final: https://example.com/ (200)". More than two hops is a chain that can almost always be cut to one. Both lines are written for Linux and macOS (grep, /dev/null); for Windows use the PowerShell variants in the selector above.
curl error messages
With -s curl stays silent on errors too. Drop the s for diagnosis or write -sS. The usual suspects:
- curl: (6) Could not resolve host: the name does not resolve in DNS, a typo or a missing A record.
- curl: (60) SSL certificate problem: certificate has expired: the certificate is past its date. Other variants of the same number name an incomplete chain or an unknown issuer. -k shows the headers anyway but fixes nothing.
- curl: (47) Maximum (50) redirects followed: a redirect loop. Without -L you see where the first hop points.
- curl: (28) after a long wait: timeout, the server does not answer on that port. --connect-timeout 5 shortens the wait.
- HTTP/2 403 or a challenge page: a firewall blocks curl's user agent. That says nothing about the headers browsers get.
- No HSTS header in the answer: you queried the http address, or the response is itself a redirect. What matters is the last hop over https.
Checking without a terminal
The HTTP header check fetches the page, lists every response header and rates each security header; the redirect checker follows every hop and reports status code, target and response time. What a redirect chain costs and how to untangle it is covered in the guide on 301 redirects.