Created
May 29, 2018 22:13
-
-
Save GarryOne/5b1ae74222f7139c9cab5b4755913ba6 to your computer and use it in GitHub Desktop.
PHP HTTP Security Headers
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 | |
header('Strict-Transport-Security: max-age=63072000; includeSubDomains; preload'); // if ssl enabled | |
header('X-Frame-Options: SAMEORIGIN'); | |
header('X-XSS-Protection: 1; mode=block'); | |
header('X-Content-Type-Options: nosniff'); | |
header('Content-Type: text/html; charset=utf-8'); | |
header('Access-Control-Allow-Origin: '.$_SERVER['HTTP_ORIGIN']); | |
header('Expect-CT: max-age=7776000, enforce'); | |
header('Referrer-Policy: origin-when-cross-origin'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment