How to configure the domain to be accessible from any subdomain

Hello,

I have a server with the IP address 99.99.99. 99 and a primary domain hosted there: example1. com. Additionally, there is another site on this server under a different user: example2. com.

Currently, when I access sub.example1. com or when I visit sub.example2. com, I encounter a message stating “Success! Your new web server is ready to use” from /var/www/html. I find this undesirable. My preference is to have example1.com
or example2.com displayed on all subdomains, including those that were not explicitly created in the control panel.

Furthermore, I would like to access the IP 99.99.99. 99 directly and see example1. com, not the message “Success! Your new web server is ready to use.”

How can I achieve these configurations?