--- title: Document Root description: The public folder where the web server looks for your site index — often public_html. Wrong root means uploads still 404. canonical: https://penasihathosting.com/en/hosting-wiki/document-root type: wiki locale: en updated: 2026-07-15 author: Willya Randika --- # Document Root ## Overview - **Summary:** The public folder where the web server looks for your site index — often public_html. Wrong root means uploads still 404. - **Author:** Willya Randika ([profile](/penulis/willya-randika)) ## Article **Document root** (also web root or `public_html`) is the server folder that is the **starting point for a domain’s public files**. When someone visits `example.com`, the web server looks for `index.php` or `index.html` there — not in a random home directory folder. Understanding the root prevents the classic moment: “I uploaded the files but the site still 404s.” Usually the files landed in the wrong folder. ## A Simple Analogy If the hosting account is a house, the document root is the **front room visible from the street**. Storage rooms can exist elsewhere for private data, but guests do not automatically see them via a URL. Leaving secrets in the front room is the same as leaving them in a downloadable web root. ## Common cPanel Patterns | Domain | Typical document root | | --- | --- | | Primary domain | `public_html/` | | [Addon domain](/en/hosting-wiki/addon-domains) | `public_html/domain/` or similar | | [Subdomain](/en/hosting-wiki/subdomain) | `public_html/sub/` or a path you choose | Modern frameworks (Laravel and others) often point the root at a `public/` subfolder so application code is not directly exposed. ## How DNS and SSL Fit In Document root is about files on disk. [DNS](/en/hosting-wiki/dns-domain-name-system) only points the hostname at the right machine. Both must match: DNS to server A while files sit on server B yields empty sites or default pages. [SSL](/en/hosting-wiki/ssl-tls) certificates are issued per hostname, not “once for every folder.” ## What to Watch For - Uploading a theme into the **wrong root** yields blank sites or the wrong brand - Do not store secrets or sensitive backups inside a downloadable web root - [FTP/SFTP](/en/hosting-wiki/ftp-sftp) paths must match the vhost document root - After migrations, align CMS URLs with the real root - Permissions that are too open or too tight both cause errors ## FAQ Often yes in modern Domains UIs. Keep DNS and SSL aimed at the same hostname. On many hosts `www` is a symlink or alias to `public_html`. Confirm in File Manager before editing. Files may sit in the home directory instead of that domain’s document root. Match paths to the domain settings. Usually in the WordPress document root or one level above `public` in custom setups. Never expose that file on a public URL.