How to enable HSTS (HTTP/2) on any site (Quick Tip)

Keeping this one short, if you are running a website on an Apache, Nginx or LiteSpeed webserver, you want to paste the following line of code to the top of your .htaccess file.

Header set Strict-Transport-Security "max-age=31536000" env=HTTPS

Once you have done that, clear your browser cache and by using a HTTP/2 tester, you should see that your website is now enforcing HTTP/2.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.