{"id":17669,"date":"2012-04-25T10:09:32","date_gmt":"2012-04-25T14:09:32","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=17669"},"modified":"2017-02-22T05:16:09","modified_gmt":"2017-02-22T10:16:09","slug":"drupal-how-to-redirect-moving-site-from-subfolder-to-server-root","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/drupal-how-to-redirect-moving-site-from-subfolder-to-server-root.html","title":{"rendered":"Drupal. How to Redirect Moving Site From Subfolder to Server Root"},"content":{"rendered":"<p>\r\n<\/p>\r\n<p>This  tutorial is going to show you how to move your Drupal site from a sub-folder to  the root folder, that is to make your site appear at \u00a0&quot;<strong>www.mysite.com<\/strong>&quot; instead\u00a0  of\u00a0 &quot;<strong>www.mysite.com\/subdirectory<\/strong>&quot; in your browser. <\/p>\r\n<p><strong>1)<\/strong> Move all files from your &ldquo;subdirectory&rdquo; folder to the root folder (often  called public_html or www). All info on how to do this should be provided by  your hosting.<br \/>\r\n<strong>2)<\/strong> Open  the <strong>.htaccess<\/strong>file that is now in your root folder in any text  editor and \u0441hange:<\/p>\r\n<p><strong>#  RewriteBase \/ subdirectory <\/strong><\/p>\r\n<p>to:<\/p>\r\n<p><strong>RewriteBase  \/<\/strong><\/p>\r\n<p>  and save the changes;<\/p>\r\n<p><strong>3)<\/strong> In the <strong>sites\/default\/settings.php<\/strong> file you need to change:<\/p>\r\n<p><strong>$base_url =  &#8216;http:\/\/www.mysite.com\/  subdirectory&rsquo;;\u00a0 \/\/ NO trailing  slash!<\/strong><\/p>\r\n<p>  and save the changes; <\/p>\r\n<p><strong>4)<\/strong> If some of your  images in  blogposts \u00a0had full links to  the domain name,  subfolder etc like &ldquo;\/ subdirectory \/file_name.extension&rdquo;,  the best way to update them for each image manually.<\/p>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"\/help\/files\/Drupal\/drupal_site_from_subdirectory_to_root_moving.htm\" target=\"blank\">Drupal. How to Redirect Moving Site From Subfolder to Server Root<\/a><\/p>\r\n<\/p>\r\n<p>\r\n<\/p>\r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>This  tutorial is going to show you how to move your Drupal site from a sub-folder to  the root folder.<\/p>\n","protected":false},"author":30,"featured_media":17671,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[723],"tags":[2564,593,1188,1184,922],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/17669"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=17669"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/17669\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/17671"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=17669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=17669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=17669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}