Last active
January 15, 2022 07:15
-
-
Save Digiover/4c2c5d0bc49b2f50e4fa95ed684b4a55 to your computer and use it in GitHub Desktop.
Add HSTS to WordPress using a send_headers action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* https://www.saotn.org/enable-http-strict-transport-security-hsts-on-iis/ | |
* follow me on Twitter: @Jan_Reilink | |
*/ | |
add_action( 'send_headers', 'saotn_add_hsts_header' ); | |
function saotn_add_hsts_header() { | |
header( 'Strict-Transport-Security: max-age=31536000; includeSubDomains; preload' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment