Skip to content

Instantly share code, notes, and snippets.

@yamanoku
Created October 14, 2017 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yamanoku/63c1a68045f07b26c7b88ae7e3e72397 to your computer and use it in GitHub Desktop.
Save yamanoku/63c1a68045f07b26c7b88ae7e3e72397 to your computer and use it in GitHub Desktop.
WordPress Security .htaccess
# 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>
# END WordPress
<IfModule mod_headers.c>
Header always set X-XSS-Protection "1; mode=block"
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options DENY
Header always set X-Download-Options: noopen
Header always set X-Powered-By: ""
</IfModule>
<IfModule mod_php5.c>
php_flag session.cookie_httponly on
php_flag session.cookie_secure On
</IfModule>
<Files wp-config.php>
order allow,deny
deny from all
</Files>
Options -Indexes
<Files ~ "^.(htpasswd|htaccess)$">
deny from all
</Files>
DirectoryIndex index.html .ht
DirectoryIndex index.htm .ht
DirectoryIndex index.php .ht
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment