Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jennimckinnon
Created May 18, 2016 23:34
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 jennimckinnon/9165452059ed7747def1e4fc5f029039 to your computer and use it in GitHub Desktop.
Save jennimckinnon/9165452059ed7747def1e4fc5f029039 to your computer and use it in GitHub Desktop.
Restrict all access to wp-includes. Source: http://www.wpexplorer.com/htaccess-wordpress-security/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
</IfModule>
@dhgutteridge
Copy link

Concerning "RewriteRule ^wp-includes/js/tinymce/langs/.+.php - [F,L]", I think that's off by one directory. There's a PHP file found in "wp-includes/js/tinymce", but not in the "langs" sub-directory.

@jennimckinnon
Copy link
Author

This was from WP Explorer as noted above so that's the best place to comment and let them know your thoughts. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment