Skip to content

Instantly share code, notes, and snippets.

@wilnaweb
Created September 10, 2018 22:54
Show Gist options
  • Save wilnaweb/171b764f8b45ffa0be7a0ca3efff1f1b to your computer and use it in GitHub Desktop.
Save wilnaweb/171b764f8b45ffa0be7a0ca3efff1f1b to your computer and use it in GitHub Desktop.
Secure .htaccess wp-admin folder
# secure .htaccess file
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
# Exclude the file upload and WP CRON scripts from authentication
<FilesMatch "(async-upload\.php|wp-cron\.php|xmlrpc\.php)$">
Satisfy Any
Order allow,deny
Allow from all
Deny from none
</FilesMatch>
# Allow access to wp-admin/admin-ajax.php
<Files admin-ajax.php>
Order allow,deny
Allow from all
Satisfy any
</Files>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment