Skip to content

Instantly share code, notes, and snippets.

@justjkk
Created December 7, 2016 08:22
Show Gist options
  • Save justjkk/47f617a2b41466e719335cce25b2df9f to your computer and use it in GitHub Desktop.
Save justjkk/47f617a2b41466e719335cce25b2df9f to your computer and use it in GitHub Desktop.
Wordpress .htaccess file with security headers
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Header set X-Frame-Options SAMEORIGIN
Header set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options nosniff
# END WordPress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment