How to Move a Website From a Subfolder to the Base Domain on cPanel

Moving website from a subfolder to the main domain on Hostinger using cPanel

Updated 2 weeks ago

If you uploaded your website and after doing so you encounter the so-called Index of issue, where your website looks similar to this instead of the uploaded content:

cPanel directory listing showing the wordpress folder and wordpress-4.5.3.zip file

You can quickly resolve it by moving your website to the proper directory, which is called public_html, also known as the document root by following these steps:

  1. Open your cPanel → File Manager:

    cPanel File Manager icon highlighted in the Files section
  2. Once inside the File Manager, open the public_html directory:

    cPanel File Manager showing public_html selected in the folder tree and file list
  3. Open the subfolder that you see inside the public_html directory (in our case, it is wordpress):

    cPanel File Manager showing the wordpress folder in public_html highlighted
  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. Select all the files and folders by clicking Select All:

    File manager with Select All checkbox highlighted above WordPress folders
  5. Right-click one of them and select Move:

    cPanel File Manager context menu with Move highlighted for index.php file
  6. Next, specify the location where you would like the files to be moved. For the main domain of your account, this is /public_html, and click on Move Files:

    cPanel file manager move dialog with /public_html path highlighted and Move Files button
  7. After the files are moved, navigate back to /public_html and remove any leftover files and folders, (in our example, wordpress-5.8.1.zip, and the wordpress folder).

  8. Finally, access your website in your browser after clearing the cache and check that everything works correctly.

That’s it! You have successfully moved your website from a subfolder to the base domain 😊

NOTES: