Last active
October 18, 2017 23:57
-
-
Save kisabelle/042d0a6cc377ecb0aba3634227d9d38e to your computer and use it in GitHub Desktop.
Mike Jolley - Keeping your shit secure: https://mikejolley.com/2013/08/13/keeping-your-shit-secure-whilst-developing-for-wordpress/ Acunetix - Top Tips to Prevent a WordPress hack: https://www.acunetix.com/websitesecurity/preventing-wordpress-hack/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Restrict direct access to PHP files from theme or plugin directories | |
# Place in root .htaccess file | |
# Restrict direct access to PHP files from plugin directories | |
RewriteCond %{REQUEST_URI} !^/wp-content/plugins/file/to/exclude\.php | |
RewriteCond %{REQUEST_URI} !^/wp-content/plugins/directory/to/exclude/ | |
RewriteRule wp-content/plugins/(.*\.php)$ - [R=404,L] | |
# Restrict direct access to PHP files from theme directories | |
RewriteCond %{REQUEST_URI} !^/wp-content/themes/file/to/exclude\.php | |
RewriteCond %{REQUEST_URI} !^/wp-content/themes/directory/to/exclude/ | |
RewriteRule wp-content/themes/(.*\.php)$ - [R=404,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prevent Direct Access to Theme/Plugin files | |
// Place at the top of your theme or plugin files | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment