Last active
March 23, 2024 17:36
-
-
Save RichardTMiles/940b533683422b684c6d0aac2fb6ead7 to your computer and use it in GitHub Desktop.
better wordpress .htaccess
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
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|xml|txt|css|js|svg|html|htm|hbs|json|map|woff|ttf|webp)$"> | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] | |
</FilesMatch> | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteRule ^xmlrpc\.php$ / [R=302,L] | |
RewriteRule ^wp-admin.*$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f [OR] | |
RewriteCond %{REQUEST_FILENAME} !-d [OR] | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d [OR] | |
RewriteRule . /index.php [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Disable XMLRPC entirely. Limit access to what WordPress PHP files can be called.
I will turn this into a script to analyze the actual wp-admin directory from LTS