How can I transfer my Drupal site from a subdirectory to my root folder?

This can be done in several easy steps.

  • Change the base dir in your settings.php to point to your root folder (public_html).

You can edit the file from your cPanel -> File Manager in the following way:

- Navigate to your /sites/default directory.
- Click on the letters next to the icon of settings.php
- A little box should appear on the top-right side of the page.
- Click on Edit File Contents and you should be able to edit the file.

  • Change the RewriteBase dir in your .htaccess file to be /

The contents of your .htaccess file should contain a line like the one below:

RewriteBase /

You can edit this file in the same way as you did with your settings.php file.

  • After that you should move all the Drupal files which are under your subdirectory to your root (public_html) folder. The best and easiest way to do this is using an FTP client.

You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!