Skip to content

Instantly share code, notes, and snippets.

@krafit
Created December 3, 2015 10:08
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 krafit/9a5a9a4f8952effa7644 to your computer and use it in GitHub Desktop.
Save krafit/9a5a9a4f8952effa7644 to your computer and use it in GitHub Desktop.
# protect the htaccess file
<files .htaccess>
order allow,deny
deny from all
</files>
# protect the log file
<FilesMatch "\.(log|txt)$">
Order Allow,Deny
Deny from all
</FilesMatch>
# protect wp-config.php
<files wp-config.php>
order allow,deny
deny from all
</files>
# protect readme.html
<files readme.html>
order allow,deny
deny from all
</files>
# protect liesmich.html
<files liesmich.html>
order allow,deny
deny from all
</files>
# protect robots.txt
<FilesMatch "robots\.txt">
Header set X-Robots-Tag "noindex"
</FilesMatch>
# protect xml-rpc.php
<IfModule mod_setenvif.c>
<Files xmlrpc.php>
Order Deny,Allow
Deny from All
Allow from env=allowed
</Files>
</IfModule>
# disable the server signature
ServerSignature Off
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment