{"id":1713,"date":"2014-10-29T11:55:02","date_gmt":"2014-10-29T11:55:02","guid":{"rendered":"http:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=1713"},"modified":"2024-04-24T09:40:38","modified_gmt":"2024-04-24T08:40:38","slug":"change-document-root-using-htaccess-file","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/","title":{"rendered":"How To Change Document Root Using .htaccess File ?"},"content":{"rendered":"<p>The time your account is created on a shared\/reseller host, by default the website loads from public_html directory. This directory is the Document Root OR the web directory. What if you want the website content to load from some other directory OR a sub directory ? <!--more--><\/p>\n<p>Simply, add the code below in .htaccess file under the account. You can create the .htaccess file using File Manager from cPanel. It will redirect to the sub directory when your domain is accessed.<\/p>\n<p><em>RewriteEngine on<br \/>\nRewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR]<br \/>\nRewriteCond %{HTTP_HOST} ^www.domain.com$<br \/>\nRewriteCond %{REQUEST_URI} !web\/<br \/>\nRewriteRule (.*) \/web\/$1 [L]<br \/>\n<\/em><\/p>\n<p>Make sure you replace domain.com with your actual domain name &amp; web with your actual sub folder.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The time your account is created on a shared\/reseller host, by default the website loads from public_html directory. This directory is the Document Root OR the web directory. What if you want the website content to load from some other directory OR a sub directory ?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"class_list":["post-1713","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-howtos"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Change Document Root Using .htaccess File ?<\/title>\n<meta name=\"description\" content=\"Learn how to change the document root using the.htaccess file and modify your website&#039;s directory to manage your content effectively.\" \/>\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.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Change Document Root Using .htaccess File ?\" \/>\n<meta property=\"og:description\" content=\"Learn how to change the document root using the.htaccess file and modify your website&#039;s directory to manage your content effectively.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-29T11:55:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-24T08:40:38+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/\",\"name\":\"How To Change Document Root Using .htaccess File ?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"datePublished\":\"2014-10-29T11:55:02+00:00\",\"dateModified\":\"2024-04-24T08:40:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/90143c7d8df4b4de36b3dbb0bb272f69\"},\"description\":\"Learn how to change the document root using the.htaccess file and modify your website's directory to manage your content effectively.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Change Document Root Using .htaccess File ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/90143c7d8df4b4de36b3dbb0bb272f69\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/42e5b55cc2772cd685c8803f6f7f854b?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/42e5b55cc2772cd685c8803f6f7f854b?s=96&d=blank&r=g\",\"caption\":\"admin\"},\"description\":\"With over 10+ years of experience in the web hosting industry, I have achieved extensive exposure to result-oriented methodologies. And expertise in different domains like Datacentre Services, Cloud computing technology, Web hosting industry and many more.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Change Document Root Using .htaccess File ?","description":"Learn how to change the document root using the.htaccess file and modify your website's directory to manage your content effectively.","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.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/","og_locale":"en_GB","og_type":"article","og_title":"How To Change Document Root Using .htaccess File ?","og_description":"Learn how to change the document root using the.htaccess file and modify your website's directory to manage your content effectively.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2014-10-29T11:55:02+00:00","article_modified_time":"2024-04-24T08:40:38+00:00","author":"admin","twitter_misc":{"Written by":"admin","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/","name":"How To Change Document Root Using .htaccess File ?","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"datePublished":"2014-10-29T11:55:02+00:00","dateModified":"2024-04-24T08:40:38+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/90143c7d8df4b4de36b3dbb0bb272f69"},"description":"Learn how to change the document root using the.htaccess file and modify your website's directory to manage your content effectively.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-document-root-using-htaccess-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How To Change Document Root Using .htaccess File ?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/90143c7d8df4b4de36b3dbb0bb272f69","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/42e5b55cc2772cd685c8803f6f7f854b?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/42e5b55cc2772cd685c8803f6f7f854b?s=96&d=blank&r=g","caption":"admin"},"description":"With over 10+ years of experience in the web hosting industry, I have achieved extensive exposure to result-oriented methodologies. And expertise in different domains like Datacentre Services, Cloud computing technology, Web hosting industry and many more.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/admin\/"}]}},"views":1491,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/1713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=1713"}],"version-history":[{"count":6,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/1713\/revisions"}],"predecessor-version":[{"id":15716,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/1713\/revisions\/15716"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=1713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=1713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=1713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}