Created
September 11, 2014 21:41
-
-
Save danielmcclure/3f5be86daa464cdaa289 to your computer and use it in GitHub Desktop.
Add HSTS to WordPress | Source: https://www.insecure.ws/2011/04/13/http-strict-transport-security-hsts-for-wp/
This file contains 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 | |
/** | |
* @package HSTS | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: HSTS - HTTP Strict Transport Security enforcement plugin | |
Author: kang@insecure.ws | |
Version: 1.0 | |
Author URI: https://www.insecure.ws | |
*/ | |
function hsts_header() | |
{ | |
isset($_SERVER['HTTPS']) && header('Strict-Transport-Security: max-age=15768000; includeSubDomains'); | |
} | |
add_action( 'send_headers', 'hsts_header' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment