{"id":67,"date":"2016-09-25T02:32:25","date_gmt":"2016-09-24T16:32:25","guid":{"rendered":"http:\/\/www.codenkeg.com\/blog\/?p=67"},"modified":"2016-09-25T02:40:31","modified_gmt":"2016-09-24T16:40:31","slug":"transparently-redirect-your-root-directory-to-a-subdirectory","status":"publish","type":"post","link":"https:\/\/www.codenkeg.com\/blog\/2016\/09\/25\/transparently-redirect-your-root-directory-to-a-subdirectory\/","title":{"rendered":"Transparently redirect your root directory to a subdirectory"},"content":{"rendered":"<p>DreamHost has instructions <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/216109967-Transparently-redirect-your-root-directory-to-a-subdirectory\">here<\/a>.<br \/>\nMake a text file called <kbd>.htaccess<\/kbd> with the following code and upload it to the domain&#8217;s root directory.<\/p>\n<pre class=\"lang:apache\" title=\".htaccess (redirect all)\">\r\nRewriteEngine on\r\nRewriteBase \/\r\n\r\nRewriteCond %{REQUEST_URI} !^\/blog\/\r\n\r\n# Rewrites all URLS [Replace \"domain\" with the actual domain, without the TLD (.com, .net, .biz, etc)]\r\nRewriteCond %{HTTP_HOST} ^(www\\.)?domain\\.\r\n\r\n# Rewrite all those to insert \/folder\r\nRewriteRule ^(.*)$ \/blog\/$1 [L]\r\n<\/pre>\n<p>Alternatively.<\/p>\n<pre class=\"lang:apache\" title=\".htaccess (redirect only root)\">\r\nRewriteEngine on\r\nRewriteCond %{HTTP_HOST} example\\.com [NC]\r\nRewriteCond %{REQUEST_URI} ^\/$\r\nRewriteRule ^(.*)$ \/blog\/$1 [L]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>DreamHost has instructions here. Make a text file called .htaccess with the following code and upload it to the domain&#8217;s root directory. RewriteEngine on RewriteBase \/ RewriteCond %{REQUEST_URI} !^\/blog\/ # Rewrites all URLS [Replace &#8220;domain&#8221; with the actual domain, without the TLD (.com, .net, .biz, etc)] RewriteCond %{HTTP_HOST} ^(www\\.)?domain\\. # Rewrite all those to insert &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.codenkeg.com\/blog\/2016\/09\/25\/transparently-redirect-your-root-directory-to-a-subdirectory\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Transparently redirect your root directory to a subdirectory&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[3],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7VdP6-15","_links":{"self":[{"href":"https:\/\/www.codenkeg.com\/blog\/wp-json\/wp\/v2\/posts\/67"}],"collection":[{"href":"https:\/\/www.codenkeg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codenkeg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codenkeg.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codenkeg.com\/blog\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":5,"href":"https:\/\/www.codenkeg.com\/blog\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":72,"href":"https:\/\/www.codenkeg.com\/blog\/wp-json\/wp\/v2\/posts\/67\/revisions\/72"}],"wp:attachment":[{"href":"https:\/\/www.codenkeg.com\/blog\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codenkeg.com\/blog\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codenkeg.com\/blog\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}