{"id":18073,"date":"2024-12-02T12:12:25","date_gmt":"2024-12-02T12:12:25","guid":{"rendered":"https:\/\/truehost.com\/support\/?post_type=docs&#038;p=18073"},"modified":"2024-12-02T12:12:27","modified_gmt":"2024-12-02T12:12:27","password":"","slug":"how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/","title":{"rendered":"How to Set Document Root outside public_html for Addon Domain OR Sub Domain"},"content":{"rendered":"\n<p>By default, cPanel places the document root for addon and subdomains inside the\u00a0<code>public_html<\/code>\u00a0directory. However, you can configure the document root to reside outside\u00a0<code>public_html<\/code>\u00a0for better organization or security. Here\u2019s how you can do it.<\/p>\n\n\n\n<p><strong>Prerequisites<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Root Access to the server&#8217;s WHM<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 1: Log in to WHM either with the root account. Normally you will use one of the URLs below;<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;your_server_ip:2087\n\nhttps:\/\/your_server_hostname:2087<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-zoooom\"><img decoding=\"async\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/11\/image-703.png\" alt=\"This image has an empty alt attribute; its file name is image-703.png\" style=\"width:1203px;height:auto\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Navigate to Home \/Server Configuration \/ Tweak Settings<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"222\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/12\/image-50-1024x222.png\" alt=\"\" class=\"wp-image-18074\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/12\/image-50-1024x222.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/12\/image-50-300x65.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/12\/image-50-768x167.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/12\/image-50.png 1245w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the search box in tweak settings to search for <strong>Restrict document<\/strong> then find the <strong>Restrict document roots to public_html\u00a0<\/strong>option, and set it to <strong>Off<\/strong><\/li>\n\n\n\n<li>Once done, click on Save.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"422\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/12\/image-51-1024x422.png\" alt=\"\" class=\"wp-image-18075\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/12\/image-51-1024x422.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/12\/image-51-300x124.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/12\/image-51-768x317.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/12\/image-51.png 1070w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>This will make it possible for addon and subdomain document root to be created in custom locations, instead of the system forcing them to <strong>public_html<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, cPanel places the document root for addon and subdomains inside the\u00a0public_html\u00a0directory. However, you can configure the document root to reside outside\u00a0public_html\u00a0for better organization or security. Here\u2019s how you can do it. Prerequisites Step 1: Log in to WHM either with the root account. Normally you will use one of the URLs below; This [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[1820,1878,1824,1879,2128],"doc_tag":[],"class_list":["post-18073","docs","type-docs","status-publish","hentry","doc_category-cloud-servers-in-kenya","doc_category-get-all-your-cpanel-help","doc_category-dedicated-servers","doc_category-servers","doc_category-vps-servers"],"year_month":"2026-06","word_count":139,"total_views":"0","reactions":{"happy":"24","normal":"0","sad":"0"},"author_info":{"name":"Eugene","author_nicename":"eugene","author_url":"https:\/\/truehost.com\/support\/author\/eugene\/"},"doc_category_info":[{"term_name":"Cloud servers in Kenya","term_url":"https:\/\/truehost.com\/support\/docs-category\/cloud-servers-in-kenya\/"},{"term_name":"Cpanel","term_url":"https:\/\/truehost.com\/support\/docs-category\/get-all-your-cpanel-help\/"},{"term_name":"dedicated servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/dedicated-servers\/"},{"term_name":"Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/servers\/"},{"term_name":"VPS-Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/vps-servers\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Set Document Root outside public_html for Addon Domain OR Sub Domain -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Document Root outside public_html for Addon Domain OR Sub Domain -\" \/>\n<meta property=\"og:description\" content=\"By default, cPanel places the document root for addon and subdomains inside the\u00a0public_html\u00a0directory. However, you can configure the document root to reside outside\u00a0public_html\u00a0for better organization or security. Here\u2019s how you can do it. Prerequisites Step 1: Log in to WHM either with the root account. Normally you will use one of the URLs below; This [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-02T12:12:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/11\/image-703.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\\\/\",\"url\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\\\/\",\"name\":\"How to Set Document Root outside public_html for Addon Domain OR Sub Domain -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/image-703.png\",\"datePublished\":\"2024-12-02T12:12:25+00:00\",\"dateModified\":\"2024-12-02T12:12:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\\\/#primaryimage\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/image-703.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/image-703.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Set Document Root outside public_html for Addon Domain OR Sub Domain\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Set Document Root outside public_html for Addon Domain OR Sub Domain -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/","og_locale":"en_US","og_type":"article","og_title":"How to Set Document Root outside public_html for Addon Domain OR Sub Domain -","og_description":"By default, cPanel places the document root for addon and subdomains inside the\u00a0public_html\u00a0directory. However, you can configure the document root to reside outside\u00a0public_html\u00a0for better organization or security. Here\u2019s how you can do it. Prerequisites Step 1: Log in to WHM either with the root account. Normally you will use one of the URLs below; This [&hellip;]","og_url":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/","article_modified_time":"2024-12-02T12:12:27+00:00","og_image":[{"url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/11\/image-703.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/","url":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/","name":"How to Set Document Root outside public_html for Addon Domain OR Sub Domain -","isPartOf":{"@id":"https:\/\/truehost.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/#primaryimage"},"image":{"@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/#primaryimage"},"thumbnailUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/11\/image-703.png","datePublished":"2024-12-02T12:12:25+00:00","dateModified":"2024-12-02T12:12:27+00:00","breadcrumb":{"@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/#primaryimage","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/11\/image-703.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/11\/image-703.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-document-root-outside-public_html-for-addon-domain-or-sub-domain\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Set Document Root outside public_html for Addon Domain OR Sub Domain"}]},{"@type":"WebSite","@id":"https:\/\/truehost.com\/support\/#website","url":"https:\/\/truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/18073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=18073"}],"version-history":[{"count":1,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/18073\/revisions"}],"predecessor-version":[{"id":18076,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/18073\/revisions\/18076"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=18073"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=18073"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=18073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}