• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved How to add custom rewrite rule for all web sites

lscpd

New Pleskian
Server operating system version
AlmaLinux 8.9
Plesk version and microupdate number
Plesk Obsidian 18.0.57.5
I want to add a custom rule that will be valid on all websites. I opened a topic on the litespeed forum and was directed here. What I want to do is to add a custom rule that will be valid on all existing and future websites.

 
You could add an event "Domain Created" by the Tools & Settings "Event Manager" to run a script that copies certain lines or a file into the domain's document root. Event handlers can use some variables. For details please see the documentation Event Handlers
 
You could add an event "Domain Created" by the Tools & Settings "Event Manager" to run a script that copies certain lines or a file into the domain's document root. Event handlers can use some variables. For details please see the documentation Event Handlers
Isn't it possible to do this by adding rules to httpd.conf or similar file? I have basic Linux knowledge.
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>

What I'm looking for is how to run this code so that it is valid on all websites.
 
You mentioned you are using Litespeed and not Apache. As I don't know Litespeed well enough I cannot give advice on this, but maybe some other forum user who knows where and how to add rewrite rules to Litespeed on the server level sees the post and can help.
 
Reading trough the Litespeed documentation for Plesk I can see the /etc/httpd/conf.d/ (for RHEL bases systems) being mentioned as a location for custom configurations. May you can add a conf file with the rule there, and see if that works?

It was exactly what I was looking for. I created block_xmlrpc.conf in the /etc/httpd/conf.d/block_xmlrpc.conf directory and added

Code:
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>

Code:
systemctl daemon-reload
service lsws restart

I ran the commands and everything is fine now :D Blocked example.com/xmlrpc.php for all websites.

Thank you. @Kaspar
 
Back
Top