Skip to content

Instantly share code, notes, and snippets.

@ctala
Last active December 14, 2019 20:58
Show Gist options
  • Save ctala/690b359a8d53309f06f780f198930c83 to your computer and use it in GitHub Desktop.
Save ctala/690b359a8d53309f06f780f198930c83 to your computer and use it in GitHub Desktop.
Example of Security Headers for a PHP application using .htaccess for Apache2
# Extra Security Headers
<IfModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
Header always append X-Frame-Options SAMEORIGIN
Header set X-Content-Type-Options nosniff
</IfModule>
# Solving Cookies created without HTTPOnly and Secure flag
php_value session.cookie_httponly 1
php_value session.cookie_secure 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment