How to Move Website From a Subfolder to the Base Domain via File Manager

How to Move Website From a Subfolder to the Base Domain via File Manager

Hosting users that are just starting out often encounter the so-called “Index of” issue, which manifests when they visit their website via their domain name just after uploading their website. Instead of being greeted with their newly uploaded website, they see a directory listing, which looks similar to this:

Directory listing

In this tutorial, you will learn how to quickly resolve this issue and move your website to the proper directory, which is called public_html, also known as the document root.

What you’ll need

Before you begin this guide you’ll need the following:

  • Access to the cPanel of your hosting account.

Moving your website from a subfolder to your base domain via File Manager

Log in to the cPanel of your hosting account and follow the instructions below:

  1. Click on the File Manager icon, located under the Files category.
    File manager location
  2. Once inside the File Manager, open the public_html directory.
    Public_html directory location
  3. Open the subfolder that you see inside the public_html directory (in our case, it is wordpress) .
    Wordpress folder location
  4. You should see all of your website’s files. You will know if you are in the right place if you see a file named index.php or index.html. Firstly, select ALL of the files and folders located in your directory by clicking Select All:
    Selecting all files
  5. Now, right-click one of them and select MOVE.
    Moving website files to publichtml
  6. In the next prompt, specify the location where you would like the files to be moved. In our case, this is /public_html
    Specify location where files will be moved
  7. After the files are moved, navigate back to public_html. It is advised to remove the leftover files and folders, which, in our example, are and the wordpress folder (which should now be empty). Select both of these items by using CTRL+Left Click and then click DELETE. This will remove the two unneeded items. You can also remove them one-by-one if you wish.
    Deleting leftover files and folders
  8. At this point, we should check inside public_html directory and see if all of your website’s files are present. In our example, they are all present.
    Final check if files were moved
  9. All that remains is to access your website and check if everything works correctly. Simply type in your domain name in your browser, such as, and check if your website works to your satisfaction. In our example, we see the default WordPress installation page, which means we successfully uploaded our website and now we are able to proceed with installing WordPress.
    Successful WordPress upload now online


We learned how to move your website from a subfolder to the document root (the public_html directory). Simple websites that have just been uploaded can be moved via the method described in this tutorial.

It is useful to note that if you have already installed a software package (for example, WordPress) into a subfolder such as /wp/, it is usually much easier to delete the installation and then re-install it into public_html , rather than moving it by hand, as such operations require users to update configuration files and other settings.

The Author


Edgaras G. / @edgaras

Edgaras is a veteran server administrator at Hostinger. He makes sure that every server runs at full throttle and has all the latest technological advancements. When he's not working, Edgaras enjoys skiing and exploring the world.

Related tutorials


Elisa Casella Reply

July 31 2020

Thank you for the tutorial! I tried this and everything worked perfectly in the subdomain, but after moving to the root domain, all of the styling is gone. I am not sure what is wrong as all of the css files are still there.


    Tomislav T.

    Replied on September 06 2020

    Hey there Elisa! :) I am not fully sure about the code you are using, but for most CMS or custom codes, you will need to fix the backlinks in the code!


Didar Reply

August 12 2020

Can you show example of Laravel project, as there is no index.php in laravel project root folder


    Tomislav T.

    Replied on November 06 2020

    Hey there Didar. If you are using Laravel you will have to define the public folder in your .htaccess. You can do that following this guide here.


Sankar Prakash Reply

August 21 2020

When I add new domain ( the directory will be created and pointed public_html directory like below, [] -> /domain/ My point is, If I am creating sub domain ex., it will create in the domain's public_html directory as a root. so now, [] -> /domain/ So this will be a problem for me, when I maintain a git repo for main domain file and sub domain file I need to separate two instance. So what I tried is wrote .htaccess in domain root folder (/domain/ So with in public_html i can place n no.of instance that control via .htaccess with below lines. RewriteEngine on RewriteCond %{HTTP_HOST} ^$ [NC,OR] RewriteCond %{HTTP_HOST} ^$ RewriteCond %{REQUEST_URI} !drupal/ RewriteRule (.*) /drupal/$1 [L] So I am not able to achieve this. I need to pint separate instance with separate folder and main domain should point one directory.


    Tomislav T.

    Replied on November 11 2020

    Hey there Sankar! :) Thanks for messaging us. The folder structure on shared hosting is not changeable, as the hosting is pre-set up, and due to it's nature, changes are not allowed. I am not fully sure what your requirements are, but you can set any folder structure you want using a VPS, or message our Customer Success team which works 24/7 to perhaps guide you through with a workaround! :)

Leave a reply




This site uses Akismet to reduce spam. Learn how your comment data is processed.

Become a part of Hostinger now!

More in Website
How to Redirect a Domain: A Complete Guide for Beginners