---
title: "Comment by mahesh sabharwal on \"HSTS Header (Strict Transport Security) Explained\" | Hashnode"
description: "Thanks for the article. But this article as well as others I have seen on the web - miss out one critical thing - where do I add these directives? You mention t"
url: "https://hashnode.com/posts/hsts-header-strict-transport-security-explained/60436a168458d42fc821b01a/comment/60534121b22fc610f73bf6d3"
---

[Discussion](https://hashnode.com/posts/hsts-header-strict-transport-security-explained/60436a168458d42fc821b01a)

Comment [HSTS Header (Strict Transport Security) Explained](https://hashnode.com/posts/hsts-header-strict-transport-security-explained/60436a168458d42fc821b01a)

[mahesh sabharwal](https://hashnode.com/@maheshs)

[Mar 18, 2021](https://hashnode.com/posts/hsts-header-strict-transport-security-explained/60436a168458d42fc821b01a/comment/60534121b22fc610f73bf6d3)

Thanks for the article. But this article as well as others I have seen on the web - miss out one critical thing - where do I add these directives?

You mention that add this directive -

`Strict-Transport-Security: max-age=60`

**Ya, but where?**

I am using Ubuntu 16.04 with Apache, MySQL and PHP.

[Teo Selenius](https://hashnode.com/@teoselenius)

[Mar 21, 2021](https://hashnode.com/posts/hsts-header-strict-transport-security-explained/60436a168458d42fc821b01a/comment/60534121b22fc610f73bf6d3#reply-6056d61b63a05a21443f2b3b)

Hey! It doesn't really matter how and where you set the header, as long as it is correctly returned to the web browser.

If you're using Apache, you can use mod\_headers like so:

Header set Strict-Transport-Security "options"

[httpd.apache.org/docs/current/mod/mod\_headers.html](https://httpd.apache.org/docs/current/mod/mod_headers.html)

Not really related to HSTS, but since you are already using Apache then check out ModSecurity and the OWASP Core Ruleset as well, it will provide you a WAF (Web Application Firewall) capability to your Apache server and protect your PHP application from most obviously malicious input.

[owasp.org/www-project-modsecurity-core-rule-set](https://owasp.org/www-project-modsecurity-core-rule-set/)
