Have you ever installed Wordpress with popular plugins that usually are available on cPanel and Direct Admin panels such as Installatron or Softaculous? These plugins let’s you install Wordpress via a few clicks without you downloading the program, unzipping it, setting up a database and going through the install process manually.
Well, these plugins are great but a lot of clients that are not familiar with Wordpress install it into a sub folder rather in the root directory and normally only realize this problem when trying to make the website live. For instance when using Softaculous the default sub directory is set to (www.mydomain.com/wp) and when using Installatron this is set to (www.mydomain.com/blog).
Now, this guide is going to show you how to easily make your website live in the root directory without a hassle and using backup/restore plugins such as Backbuddy or anything similar.
First, login via cPanel and click on the File Manager icon.
Double click on public_html
Go into the sub direct where Wordpress is installed and click on Settings and select Show hidden files. This is very important because the .htaccess file is hidden.
Select the index.php and .htaccess files by holding down Ctrl and clicking on the files one by one, click on Copy. Choose the folder you would like to copy these files to (remove the sub directory) and click on the Copy File(s) button. Then click on the Up one Level button to go to your root directory where you have copied the 2 files.
Click on the index.php file and choose Edit.
Then change the following line: (change wp to your sub directory where Wordpress is installed)
require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );
TO
require( dirname( __FILE__ ) . ‘/wp/wp-blog-header.php’ );
Login to your Wordpress website, click on Settings > General and remove the sub directory (wp) from the Site Address (URL) setting.