This guide explains how you can change the web root of your web application. Any custom web root folder must be within public_html.
How to Change the Web Root of an Application
Step 1: Go to Application Management
Log into the Cloudways Platform with your credentials. Click on Applications in the top menu bar and then select your target application from the list.
Step 2: Change the Web Root
As explained, the new web root must be within the public_html folder. In this example, we have created a directory called web under public_html through SSH. To set this folder as the new web root, we simply type it in the Webroot field as seen below.
Once this has been done, the web server will start serving files from this new location.
Please make sure that the custom web root you created contains the necessary web files (index.php or index.html …) or your website will not work.
In case if intended new webroot doesn’t exist in public_html, the process will create automatically.
That’s it! We hope this article was helpful. If you need any help, then feel free to search your query on Cloudways Support Center or contact us via chat (Need a Hand > Send us a Message). Alternatively, you can also create a support ticket.