The document root is the folder on the server where a domain’s website files live. Changing it lets you point a domain to a different folder, which is useful when reorganising sites or running an app from a subfolder. This guide explains how in DirectAdmin.
What the document root is #
By default, a domain’s files live in a folder like public_html (or a domain-specific folder). The document root is simply which folder the domain serves as the website. Changing it tells the server to load a different location.
When you might change it #
- Moving a site into a cleaner folder structure.
- Pointing a domain at a framework’s public subfolder.
- Serving a rebuilt site from a new directory.
Changing the document root #
- Log in to DirectAdmin.
- Open Domain Setup and select the domain.
- Find the option to set or change the document root / private_html handling.
- Enter the new folder path.
- Save.
After changing #
- Make sure your website files are actually in the new folder.
- Reload your site to confirm it serves the right content.
- Update any hardcoded paths if needed.
Troubleshooting #
- Site shows a blank page or index list: confirm your files, including index, are in the new document root.
- Old content still loads: clear caching and reload.
Need help? #
If changing the document root causes issues, our support team can help over live chat.