Skip to content

Instantly share code, notes, and snippets.

Created March 22, 2016 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/83fb368e8cbb7d32c859 to your computer and use it in GitHub Desktop.
Save anonymous/83fb368e8cbb7d32c859 to your computer and use it in GitHub Desktop.
Strict-Transport-Security Header
<?php
// Raw header
Strict-Transport-Security: max-age=31536000
// or
Strict-Transport-Security: max-age=31536000; includeSubDomains
// How to send the response header with PHP
header("Strict-Transport-Security: max-age=31536000");
// How to send the response header with Apache (.htaccess)
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=31536000"
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment