{"id":1713,"date":"2014-10-29T11:55:02","date_gmt":"2014-10-29T11:55:02","guid":{"rendered":"http:\/\/www.milesweb.com\/hosting-faqs\/?p=1713"},"modified":"2020-08-13T11:01:02","modified_gmt":"2020-08-13T11:01:02","slug":"change-document-root-using-htaccess-file","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/","title":{"rendered":"How To Change Document Root Using .htaccess File?"},"content":{"rendered":"<p><strong>Watch this video for a step by step process on how to change document root using .htaccess file?<\/strong><\/p>\n<div class=\"youtube-video\" style=\"border: 1px solid #ddd;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/QdHHpqWktkY\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n<p>The time your account is created on a <a href=\"https:\/\/www.milesweb.in\/hosting\/shared-hosting\">shared hosting<\/a>\/<a href=\"https:\/\/www.milesweb.in\/hosting\/reseller-hosting\/\">reseller hosting<\/a>, 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><strong>RewriteEngine on<\/strong><br \/>\n<strong> RewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR]<\/strong><br \/>\n<strong> RewriteCond %{HTTP_HOST} ^www.domain.com$<\/strong><br \/>\n<strong> RewriteCond %{REQUEST_URI} !web\/<\/strong><br \/>\n<strong> RewriteRule (.*) \/web\/$1 [L]<\/strong><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<p><script type=\"application\/ld+json\">{\n  \"@context\": \"http:\/\/schema.org\",\n  \"@type\": \"VideoObject\",\n  \"name\": \"How to Change Document Root Using .htaccess File? | MilesWeb\",\n  \"description\": \"In this video, you will learn how to change document root using .htaccess file.  Here's an in-depth guide on How to change document root using .htaccess File: https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/  Give a thumbs up ?? if you liked this video.  Subscribe to our channel and get notified for all the latest videos.  To know more about web hosting visit our website- https:\/\/www.milesweb.in\",\n  \"thumbnailUrl\": \"https:\/\/i.ytimg.com\/vi\/QdHHpqWktkY\/default.jpg\",\n  \"uploadDate\": \"2020-04-29T18:09:02Z\",\n  \"duration\": \"PT1M54S\",\n  \"embedUrl\": \"https:\/\/www.youtube.com\/embed\/QdHHpqWktkY\",\n  \"interactionCount\": \"360\"\n}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Watch this video for a step by step process on how to change document root using .htaccess file? The time your account is created on a shared hosting\/reseller hosting, 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 [&hellip;]<\/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 v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Change Document Root Using .htaccess File?<\/title>\n<meta name=\"description\" content=\"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.\" \/>\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.in\/hosting-faqs\/change-document-root-using-htaccess-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\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=\"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.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/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=\"2020-08-13T11:01:02+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=\"Est. 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\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/\"},\"author\":{\"name\":\"Admin\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/90143c7d8df4b4de36b3dbb0bb272f69\"},\"headline\":\"How To Change Document Root Using .htaccess File?\",\"datePublished\":\"2014-10-29T11:55:02+00:00\",\"dateModified\":\"2020-08-13T11:01:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/\"},\"wordCount\":148,\"commentCount\":0,\"articleSection\":[\"How-Tos\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/\",\"name\":\"How To Change Document Root Using .htaccess File?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"datePublished\":\"2014-10-29T11:55:02+00:00\",\"dateModified\":\"2020-08-13T11:01:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/90143c7d8df4b4de36b3dbb0bb272f69\"},\"description\":\"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.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Change Document Root Using .htaccess File?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/90143c7d8df4b4de36b3dbb0bb272f69\",\"name\":\"Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/02\/MilesWeb-Logo-150x150.png\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/02\/MilesWeb-Logo-150x150.png\",\"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.in\/hosting-faqs\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Change Document Root Using .htaccess File?","description":"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.","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.in\/hosting-faqs\/change-document-root-using-htaccess-file\/","og_locale":"en_US","og_type":"article","og_title":"How To Change Document Root Using .htaccess File?","og_description":"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.","og_url":"https:\/\/www.milesweb.in\/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":"2020-08-13T11:01:02+00:00","author":"Admin","twitter_misc":{"Written by":"Admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/"},"author":{"name":"Admin","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/90143c7d8df4b4de36b3dbb0bb272f69"},"headline":"How To Change Document Root Using .htaccess File?","datePublished":"2014-10-29T11:55:02+00:00","dateModified":"2020-08-13T11:01:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/"},"wordCount":148,"commentCount":0,"articleSection":["How-Tos"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/","name":"How To Change Document Root Using .htaccess File?","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"datePublished":"2014-10-29T11:55:02+00:00","dateModified":"2020-08-13T11:01:02+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/90143c7d8df4b4de36b3dbb0bb272f69"},"description":"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.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/change-document-root-using-htaccess-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How To Change Document Root Using .htaccess File?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/90143c7d8df4b4de36b3dbb0bb272f69","name":"Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/02\/MilesWeb-Logo-150x150.png","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/02\/MilesWeb-Logo-150x150.png","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.in\/hosting-faqs\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/1713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=1713"}],"version-history":[{"count":6,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/1713\/revisions"}],"predecessor-version":[{"id":10086,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/1713\/revisions\/10086"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=1713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=1713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=1713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}