{"id":6088,"date":"2026-07-15T12:06:07","date_gmt":"2026-07-15T09:06:07","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=6088"},"modified":"2026-07-15T12:06:08","modified_gmt":"2026-07-15T09:06:08","slug":"change-document-root-spanel","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/change-document-root-spanel\/","title":{"rendered":"How to Change a Domain&#8217;s Document Root in SPanel"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In SPanel, open <strong>Domains<\/strong>, use a domain&#8217;s <strong>Actions <\/strong>menu to open <strong>Settings<\/strong>, and edit the <strong>Document Root<\/strong> field. Click <strong>Save<\/strong>. SPanel rewrites the web-server configuration so the domain serves from the new directory and keeps SSL renewals working. One important caveat: changing the document root does not move your files, so the target directory must already contain your site or the domain will return a 404 error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Who this is for<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is for site owners who need a domain to serve from somewhere other than the default public_html &#8211; pointing a domain at a staging build, at a subfolder that holds a separate site, or at a framework&#8217;s public directory (the public or web folder that ships with many PHP frameworks). You manage this yourself from the SPanel UserInterface.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What problem this solves<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By default a domain serves from public_html, but plenty of setups don&#8217;t live there. A PHP framework keeps its front controller in a public subfolder while the application code sits one level up, outside the web root for safety. A staging copy might sit in its own directory while you prepare a launch. The Document Root field lets you tell the domain which directory to serve, without editing server configuration by hand.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How SPanel solves this<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open <strong>Domains <\/strong>in SPanel. Each domain is listed in a row with an <strong>Actions <\/strong>menu; choosing <strong>Settings <\/strong>opens the dialog titled &#8220;Settings for &lt;domain&gt;&#8221;. The first field there is <strong>Document Root<\/strong>. It shows a fixed prefix of \/home\/&lt;user&gt;\/ that you cannot edit, followed by an editable suffix that defaults to public_html. A <strong>Browse <\/strong>button lets you pick an existing directory instead of typing the path. After navigating to the correct directory, click <strong>Save<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why this is different in SPanel<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Two things happen automatically. First, SPanel rewrites the web-server vhost &#8211; both the LiteSpeed\/Apache layer and Nginx &#8211; so the new root serves consistently across the stack. Second, SPanel fixes the Let&#8217;s Encrypt renewal webroot in the same action, so your certificate keeps renewing from the correct directory after the move. You don&#8217;t edit configuration files or re-run a certificate command yourself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Before you start<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You need access to the SPanel User Interface for the account that owns the domain.<\/li>\n\n\n\n<li>Make sure the target directory already exists and contains your site files, including an index file. The change repoints the domain; it does not create or move anything.<\/li>\n\n\n\n<li>If you&#8217;re repointing a live domain, copy or move the files into the new directory first, so visitors never hit an empty folder.<\/li>\n\n\n\n<li>Use the <strong>Browse <\/strong>button for easier navigation to the correct document root folder.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step-by-step<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In SPanel&#8217;s User Interface, go to <strong>Domains<\/strong>. You&#8217;ll see each domain listed with its current document root, which helps you confirm you&#8217;re editing the right one.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><img decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2026\/07\/01-domains-list-1024x640.webp\" alt=\"How to Change a Domain&#8217;s Document Root in SPanel, Step-by-step\" class=\"wp-image-6089\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2026\/07\/01-domains-list-1024x640.webp 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2026\/07\/01-domains-list-300x188.webp 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2026\/07\/01-domains-list-768x480.webp 768w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2026\/07\/01-domains-list.webp 1440w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Find the domain you want to change &#8211; in our example, yoga.life &#8211; and open its <strong>Actions <\/strong>menu, then choose <strong>Settings<\/strong>. The &#8220;Settings for &lt;domain>&#8221; dialog opens with Document Root as the first field.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><img decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2026\/07\/02-settings-docroot-1024x640.webp\" alt=\"How to Change a Domain&#8217;s Document Root in SPanel, Step-by-step 2\" class=\"wp-image-6090\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2026\/07\/02-settings-docroot-1024x640.webp 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2026\/07\/02-settings-docroot-300x188.webp 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2026\/07\/02-settings-docroot-768x480.webp 768w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2026\/07\/02-settings-docroot.webp 1440w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Enter the correct path in the field. Type the directory name or click <strong>Browse <\/strong>to select the right one &#8211; for our example, the test target subdirectory that holds an index file. Double-check the path before continuing, since saving immediately changes what visitors see.<\/li>\n\n\n\n<li>Click <strong>Save<\/strong>. SPanel applies the change, rewrites the web-server configuration, and updates the Let&#8217;s Encrypt webroot. Reload the domain; you should see the site served from the new directory rather than public_html.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What happens behind the scenes<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When you Save, SPanel updates the vhost that maps the domain to a directory on disk, across both the LiteSpeed\/Apache and Nginx layers. Because the document root is part of how Let&#8217;s Encrypt validates a renewal, SPanel also repoints the certificate&#8217;s renewal webroot to match. The fixed \/home\/&lt;user&gt;\/ prefix is a safety boundary: it keeps the served directory inside your own account, so you can&#8217;t point a domain at another user&#8217;s files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Limitations and edge cases<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Changing the document root does not move your files.<\/strong> It only changes which directory the domain serves. If the new directory is empty or missing your index file, the site returns a 404 error. Copy your files into the target directory first.<\/li>\n\n\n\n<li><strong>SSL renewal webroot is handled for you, but allow for brief propagation.<\/strong> SPanel updates the Let&#8217;s Encrypt webroot when the root changes, but give it a short window to settle before assuming a renewal problem. The certificate itself stays valid throughout.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Troubleshooting<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table is-style-regular green-rows\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Symptom<\/strong><\/td><td><strong>Likely cause<\/strong><\/td><td><strong>What to do<\/strong><\/td><\/tr><tr><td>Domain returns a 404 error after saving<\/td><td>The new directory is empty or has no index file<\/td><td>Move or copy your site files, including an index file, into the target directory<\/td><\/tr><tr><td>Site still serves the old content<\/td><td>Browser or server cache<\/td><td>Hard-refresh the page, or clear the cache, then reload<\/td><\/tr><tr><td>Wrong directory served<\/td><td>A typo in the suffix after \/home\/&lt;user>\/<\/td><td>Reopen Settings and correct the Document Root, or use Browse to pick the right folder<\/td><\/tr><tr><td>Certificate renewal seems off shortly after a change<\/td><td>Webroot relocation is still propagating<\/td><td>Wait briefly, then recheck; the existing certificate stays valid meanwhile<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>When to use this \/ when not to use this<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table is-style-regular green-rows\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Use this when<\/strong><\/td><td><strong>Skip or use something else when<\/strong><\/td><\/tr><tr><td>You want a domain to serve from a framework&#8217;s public directory<\/td><td>You just need to upload files to the existing root &#8211; use the File Manager<\/td><\/tr><tr><td>You&#8217;re pointing a domain at a staging subdirectory<\/td><td>You want to move files between folders &#8211; that&#8217;s a File Manager task<\/td><\/tr><tr><td>A subfolder holds a separate site you want the domain to serve<\/td><td>You haven&#8217;t placed any files in the target directory yet<\/td><\/tr><tr><td>You&#8217;re consolidating a site that lives outside public_html<\/td><td>The change would point outside your \/home\/&lt;user>\/ space &#8211; that isn&#8217;t allowed<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>FAQ<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>Does changing the document root move my website files?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> No. It only changes which directory the domain serves. Put your files in the target directory first, or the site will return a 404 error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>Will my SSL certificate break when I change the root?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> The certificate stays valid. SPanel updates the Let&#8217;s Encrypt renewal webroot in the same action, though you should allow a short propagation window before assuming a renewal issue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>Where do I find the Document Root field?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> Open <strong>Domains<\/strong>, use the domain&#8217;s Actions menu, choose Settings, and it&#8217;s the first field in the &#8220;Settings for &lt;domain>&#8221; dialog.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>Do I have to edit any configuration files myself?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> No. SPanel rewrites the web-server vhost across the LiteSpeed\/Apache and Nginx layers for you when you Save.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>Why does my domain show 404 right after I save?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> Usually the new directory has no index file or no site files yet. Add them and reload.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>Can I change the root back to public_html later?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> Yes. Reopen Settings, set the suffix back to public_html, and Save. The same rewrite and webroot update apply.<\/p>\n\n\n\n<script type=\"application\/ld+json\">\n    {\n      \"@context\": \"https:\/\/schema.org\",\n      \"@type\": \"FAQPage\",\n      \"mainEntity\": [{\n        \"@type\": \"Question\",\n        \"name\": \"Does changing the document root move my website files?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"No. It only changes which directory the domain serves. Put your files in the target directory first, or the site will return a 404 error.\"\n        }\n      }, {\n        \"@type\": \"Question\",\n        \"name\": \"Will my SSL certificate break when I change the root?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"The certificate stays valid. SPanel updates the Let's Encrypt renewal webroot in the same action, though you should allow a short propagation window before assuming a renewal issue.\"\n        }\n      },{\n        \"@type\": \"Question\",\n        \"name\": \"Where do I find the Document Root field?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"Open Domains, use the domain's Actions menu, choose Settings, and it's the first field in the \"Settings for <domain>\" dialog.\"\n        }\n      },{\n        \"@type\": \"Question\",\n        \"name\": \"Do I have to edit any configuration files myself?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"No. SPanel rewrites the web-server vhost across the LiteSpeed\/Apache and Nginx layers for you when you Save.\"\n        }\n      },{\n        \"@type\": \"Question\",\n        \"name\": \"Why does my domain show 404 right after I save?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"Usually the new directory has no index file or no site files yet. Add them and reload.\"\n        }\n      },{\n        \"@type\": \"Question\",\n        \"name\": \"Can I change the root back to public_html later?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"Yes. Reopen Settings, set the suffix back to public_html, and Save. The same rewrite and webroot update apply.\"\n        }\n      }]\n    }\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>In SPanel, open Domains, use a domain&#8217;s Actions menu to open Settings, and edit the Document Root field. Click Save. SPanel rewrites the web-server configuration so the domain serves from the new directory and keeps SSL renewals working. One important caveat: changing the document root does not move your files, so the target directory must [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_titles_title":"Change a Domain's Document Root in SPanel | ScalaHosting KB","_seopress_titles_desc":"Change a domain's document root in SPanel to serve from a framework public folder, staging area, or subfolder. SPanel rewrites the vhost and renews SSL.","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"","_seopress_redirections_param":"","_seopress_redirections_type":0,"_seopress_analysis_target_kw":"","_seopress_news_disabled":"","_seopress_video_disabled":"","_seopress_video":[],"_seopress_pro_schemas_manual":[],"_seopress_pro_rich_snippets_disable_all":"","_seopress_pro_rich_snippets_disable":[],"_seopress_pro_schemas":[],"footnotes":""},"categories":[66],"tags":[],"class_list":["post-6088","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/6088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/comments?post=6088"}],"version-history":[{"count":3,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/6088\/revisions"}],"predecessor-version":[{"id":6095,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/6088\/revisions\/6095"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=6088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=6088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=6088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}