What a response header is
When a browser asks for your page, whatever serves it replies with the page and a short list of instructions about how to treat it. A few of those instructions are about security: never load this site over plain HTTP again, do not let another site put this page in a frame, do not guess what kind of file this is. None of them need a code change. On most hosting they are a toggle or one line of configuration, and they protect your visitors in ways a padlock icon alone does not.
Six to send, in the order to turn them on
The order matters because one of these can break a site and the rest cannot. Start with the ones that are safe everywhere.
1. X-Content-Type-Options: nosniff. Stops the browser from guessing a file's type and running something that was supposed to be text. It has never broken a site I have seen. If you turn on nothing else, turn on this.
2. Referrer-Policy: strict-origin-when-cross-origin. When a visitor clicks a link off your site, the destination learns your domain name, not the full address of the page they were on. Modern browsers behave this way by default. Sending the header makes it true in older ones and makes your intent explicit.
3. Frame protection. X-Frame-Options: DENY,
and the newer form, frame-ancestors 'none', inside the
content security policy below. Send both; older browsers only read
the first. This stops another site loading your pages inside an
invisible frame and tricking a visitor into clicking something on
them. The one exception is a site you embed in your own other
properties, which wants SAMEORIGIN instead.
4. Strict-Transport-Security. Tells the browser: for
the next year, never talk to this site over plain HTTP, even if
someone types it or a link says so. The value is
max-age=31536000; includeSubDomains. Turn it on only
after you have confirmed that every hostname under the domain serves
HTTPS with a valid certificate, and leave includeSubDomains
off until you have checked the ones you forgot about, such as a
webmail or admin hostname an old host set up. Once a browser has seen
this header, it will refuse plain HTTP to those names for a year, and
you cannot take that back from the visitor's side.
5. Permissions-Policy. Switches off browser features the site never uses: camera, microphone, location, payment. A brochure site needs none of them. This is the one I do not send yet on my own site, and I would rather say so here than have you find it in a scan. It is on the list.
6. Content-Security-Policy, last and carefully. The
strongest of the six, and the only one that breaks sites. It lists
where scripts, styles, images and frames may be loaded from, and the
browser refuses anything else. Start with the report-only form,
Content-Security-Policy-Report-Only, read what it would
have blocked, fix or allow each item, and only then switch to
enforcing. A site built on a content-management system with plugins
will fight you here, because plugins inject their own scripts; a
looser policy that still bans frames and plugins is a fine place to
stop.
One to remove
Three of the fifteen sites I checked sent
x-powered-by: PHP/8.5.12 with every page. A version
number tells an attacker which known weaknesses to try first. It is
free to switch off, and nothing on the visitor's side needs it.
Server banners that announce a version belong in the same bin.
What my own site sends, and how
Every page on stingrayio.com comes back with these:
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-frame-options: DENY
referrer-policy: strict-origin-when-cross-origin
content-security-policy: default-src 'self'; img-src 'self' data:;
style-src 'self'; script-src 'self'; object-src 'none';
base-uri 'none'; form-action 'none'; frame-ancestors 'none';
upgrade-insecure-requests
There is no web server to configure. The site is static files in object storage behind a CDN, and the CDN attaches a response headers policy to every reply. One policy object, attached to the distribution, applied to every page and asset. The same policy would cover a hundred sites. The distribution also refuses TLS older than 1.2 and speaks HTTP/2 and HTTP/3, which are settings on the same screen.
What that policy costs me. No inline scripts or
styles anywhere. The contact button assembles its email address in a
separate script file, partly so the address is not in the page source
for harvesters, and partly so the policy can stay at
'self' with no hash to recompute every time the copy
changes. No third-party fonts, no analytics tag, no embedded map or
video unless I add their origins on purpose. form-action
'none' because the site has no forms. A policy this strict
works because the site is this simple. The policy should fit the site,
not the other way round.
What fifteen local sites send
In November 2026 I made one read-only request to each of fifteen small-business sites built by West Virginia web shops, the kind of shops whose design work I would recommend, and read the headers that came back. No site is named here, and the designers are not the problem. These are hosting settings, not design decisions, and the owner carries the exposure either way.
| Header | Sent by |
|---|---|
| Strict-Transport-Security | 2 of 15 |
| Frame protection (either form) | 2 of 15 |
| Content-Security-Policy (any policy at all) | 4 of 15 |
| Announced a PHP version | 3 of 15 |
One of the fifteen no longer resolved at all, though it was still listed as a client on the shop's homepage. I did not grade the four content security policies for strength; sending one is already unusual. Four of the fifteen sat behind a well-known CDN and three of those sent none of the six, because that CDN does not turn any of them on by default. The switch for the first header is under its TLS settings and the rest are a few response-header rules, all on the free plan.
How to add them where you are
- Behind Cloudflare: SSL/TLS, Edge Certificates, HSTS for the first one. Rules, Transform Rules, Modify Response Header for the rest. Free plan.
-
Apache shared hosting: a
.htaccessfile with oneHeader always setline per header, if the host enables mod_headers. Most do. -
nginx:
add_header ... always;lines in the server block. - Website builders (Wix, Squarespace and the like): you mostly cannot. They set a few themselves. Check what they send and decide whether it is enough for what the site does.
- Static files behind a CDN: a response headers policy, as above. CloudFront, Cloudflare Pages and Netlify all have one.
Check your work from any terminal, or paste the domain into securityheaders.com for a letter grade:
curl -sI https://yourdomain.com | grep -iE 'strict|content-security|x-frame|x-content|referrer|permissions|x-powered'
What it costs
Nothing, and about an hour, with an afternoon in report-only mode if you go as far as a content security policy. For the businesses I look after, the headers are part of the free check, and fixing them is included in every care plan. If you only want the check, take it. The note tells you which of the six you are missing and where the switch is on your hosting.