Hey guys!
I got a VPS with Ubuntu 20.04, Cyberpanel and OpenLiteSpeed, and launched a WordPress website there. All good, up until I realized /xmlrpc.php was not blocked/denied (despite having implemented code in .htaccess for it).
I checked the code and rewrote it accordingly to OLS, no dice. Xmlrpc (readme.html, etc.) still accessible. I’ve tried blocking xmlrpc.php through WP functions.php - again, ignored. I’ve tried a couple of plugins, just to test if they’d work, to no avail.
After a couple of days and dozens of hours, I managed to get it to correctly deny it after adding the rewrite rules once again inside Cyberpanel → Website → Rewrite Rules (basically same as .htaccess), all whilst in OLS Webadmin Rewrite Rules are enabled and Auto Loaded from .htaccess.
It worked for a bit, the files seemed to be blocked, but today, I was doing some testing and noticed they were available once again (despite the exact same code being still in place, correctly).
I have no idea left as to what could override it or why they’re ignored at this point.
I’ve also ruled out every single plugin I’m using (as well as my theme) as culprits. This could only be due to OLS I believe, or something else that I might be missing.
Any help or ideas would be much appreciated - thank you kindly!
Here are the Rewrite Rules I had:
I got a VPS with Ubuntu 20.04, Cyberpanel and OpenLiteSpeed, and launched a WordPress website there. All good, up until I realized /xmlrpc.php was not blocked/denied (despite having implemented code in .htaccess for it).
I checked the code and rewrote it accordingly to OLS, no dice. Xmlrpc (readme.html, etc.) still accessible. I’ve tried blocking xmlrpc.php through WP functions.php - again, ignored. I’ve tried a couple of plugins, just to test if they’d work, to no avail.
After a couple of days and dozens of hours, I managed to get it to correctly deny it after adding the rewrite rules once again inside Cyberpanel → Website → Rewrite Rules (basically same as .htaccess), all whilst in OLS Webadmin Rewrite Rules are enabled and Auto Loaded from .htaccess.
It worked for a bit, the files seemed to be blocked, but today, I was doing some testing and noticed they were available once again (despite the exact same code being still in place, correctly).
I have no idea left as to what could override it or why they’re ignored at this point.
I’ve also ruled out every single plugin I’m using (as well as my theme) as culprits. This could only be due to OLS I believe, or something else that I might be missing.
Any help or ideas would be much appreciated - thank you kindly!
Here are the Rewrite Rules I had:
Code:
RewriteCond %{REQUEST_URI} ^(.*)?readme\.html(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?readme\.txt(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?xmlrpc\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-trackback\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?license\.txt(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-config\.php(.*)$
RewriteRule ^/wp-admin/install\.php$ - [F]
RewriteRule ^/wp-admin/includes/ - [F]
RewriteRule !^/wp-includes/ - [S=3]
RewriteRule ^/wp-includes/[^/]+\.php$ - [F]
RewriteRule ^/wp-includes/js/tinymce/langs/.+\.php - [F]
RewriteRule ^/wp-includes/theme-compat/ - [F]
RewriteRule (^|.*/)\.(git|svn)/.* - [F]
RewriteRule ^/wp-content/uploads/.*\.(?:php[1-7]?|pht|phtml?|phps)\.?$ - [NC,F]
RewriteRule ^/wp-content/plugins/.*\.(?:php[1-7]?|pht|phtml?|phps)\.?$ - [NC,F]
RewriteRule ^/wp-content/themes/.*\.(?:php[1-7]?|pht|phtml?|phps)\.?$ - [NC,F]