-
-
Save doxt3r/ed16a9224bd480cdb1ec1506af23bb80 to your computer and use it in GitHub Desktop.
Restrict Direct Access to Plugin and Theme PHP files in WordPress. Source: https://www.acunetix.com/websitesecurity/wordpress-security-top-tips-secure-wordpress-application/
This file contains 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
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] | |
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] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment