Skip to content
Free website migration on every plan, done by our team.Learn more ›
Security

HTTP security headers every website should have

The security headers that protect visitors (HSTS, Content-Security-Policy, X-Content-Type-Options, Referrer-Policy and more), with examples.

Short answer: Security headers are instructions your server sends with each page to tell browsers how to protect visitors. The key ones are HSTS, Content-Security-Policy, X-Content-Type-Options, frame protection, Referrer-Policy and Permissions-Policy. They can be added in .htaccess or by your host.

The headers

HeaderWhat it does
Strict-Transport-Security (HSTS)Forces HTTPS on future visits
Content-Security-PolicyLimits where scripts and content can load from
X-Content-Type-Options: nosniffStops browsers guessing file types
X-Frame-Options or frame-ancestorsPrevents your site being framed by others
Referrer-PolicyControls what's shared about the previous page
Permissions-PolicyTurns off features like camera access you don't use

Adding them

On Apache or LiteSpeed, you can add headers in .htaccess:

Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"

See .htaccess basics. Our own site sends a full set of these headers.

Test carefully

A strict Content-Security-Policy can block legitimate scripts. Start in report-only mode, check what breaks, then enforce. Online header scanners show what your site sends today.

Frequently asked questions

Do headers improve SEO?

Not directly, but they protect visitors and trust.

Is HSTS risky?

Only if HTTPS isn't working on every subdomain you include. Make sure SSL covers everything first.

Ready when you are

Host it where it performs

NVMe speed, offshore privacy and a written SLA — live in minutes on AuroxHost.