Skip to content

Knowledgebase

Changing a Plesk website document root safely

plesk, web-hosting

The document root identifies the directory a domain serves publicly. Changing it is useful when an application keeps its public entry point in a dedicated folder, but choosing the project root can expose configuration, source files or backups that were never meant for visitors.

Prepare for the change

Identify the application public directory and back up the current site. Record the existing document root, PHP settings and custom web-server rules. Confirm the target is inside the permitted subscription space and does not belong to an unrelated site.

01 Change a Plesk website document root safely

  1. Prepare the target directory and deploy the expected public files before changing the live setting. Keep private configuration and storage outside that public directory when the application design requires it.
  2. Open the domain Hosting Settings and locate Document root. Enter the intended path in the format requested by Plesk.
  3. Review the domain and path carefully, then save. Changing this field is not a substitute for deploying the application or migrating its data.
  4. Check application base paths, uploads, redirects and any directory-specific protection. Update only the settings that depend on the moved public entry point.
  5. Test a representative public page and deliberately request a private filename that must not be downloadable. Ensure the test itself does not reveal sensitive content to third parties.

How do I check the new public document root?

Confirm the intended application loads over HTTPS and private files are not served. Check relative assets, uploads, application routing and scheduled tasks whose paths might differ from the web root.

If the change does not work

If Plesk shows a default page, inspect the exact target directory and its index file. If the application fails, use its error log and compare filesystem paths before changing permissions. Restore the old document root to recover the prior request mapping when safe. Do not delete the old directory until the replacement is verified and retention requirements are met.

Sources and further reading

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support

Powered by WHMCompleteSolution