Created
February 15, 2020 19:39
-
-
Save Horttcore/f6a06f37add7b84e801ce9eb41f13bc5 to your computer and use it in GitHub Desktop.
Protect WordPress folders and contents
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
# PROTECT WORDPRESS FOLDERS AND CONTENTS. | |
RewriteCond %{REQUEST_URI} /wp-admin/ | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteCond %{REQUEST_URI} \.php$ [NC] | |
RewriteCond %{REQUEST_URI} !/wp-admin/(load-styles|admin-ajax)\.php$ | |
RewriteCond %{HTTP:Cookie} !wordpress_logged_in_.+ | |
RewriteRule .* - [G,L] | |
RewriteCond %{REQUEST_URI} /wp-includes/ | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteCond %{REQUEST_URI} \.php$ [NC] | |
RewriteCond %{REQUEST_URI} !/wp-includes/js/tinymce/wp-tinymce\.php$ | |
RewriteCond %{HTTP:Cookie} !wordpress_logged_in_.+ | |
RewriteRule .* - [G,L] | |
RewriteCond %{REQUEST_URI} /wp-content/ | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteCond %{REQUEST_URI} !\.((s?c|le)ss|js(on(p)?)?|gif|ico|jpe?g?|png|svgz?|tiff?|avi|mp(3|4|(e|g)|eg)|eot|otf|tt(f|c)|woff2?)$ [NC] | |
RewriteRule .* - [G,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment