When you install WordPress through softaculous and forget to leave the directory field empty, the website files will automatically be stored in the /wp directory according to the WordPress default. For example, access to namadomain.com/wp. Then, how can you access it using namadomain.com?
In order to be accessed using a domain name, you must move the files from the /wp directory to the public_html or root domain directory. Here's how to move WordPress files from the /wp directory to the domain directory:
This guide can only be used for the main domain that has a public_html root directory. If you are moving subdomains or addon domains, make sure to move them to their respective main directory, not to public_html.
1. First login to cPanel and click file manager then go to the public_html menu.
2. After entering the file manager menu then public_html, please open the folder where your WordPress files are located. In the screenshot below, the WordPress files are located in the/wp folder
3. After entering the wp folder menu, click select all files in the folder.
4. After making sure all the files have been selected then you click move and move them to public_html and then click Move File(s).
5. After moving the files, make sure that the files in the wp folder have now moved to public_html.
6. After making sure the WordPress file is in public_html, please return to the cPanel home page and click phpMyAdmin.
7. After entering the phpMyAdmin page, click on the database used by your WordPress and select wp-options.
8. After clicking wp-options, click edit on siteurl and home.
9. Then change the record by removing the folder name after the domain name. For example, from http://namadomain.com/wp to http://namadomain.com then click go.
10. After changing the link you can access with namadomain.com without /wp.
11. Edit file .htaccess.
Please edit the .htaccess file, then make sure RewriteBase and RewriteRule no longer point to /wp/. Make sure your .htaccess script looks like the following:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>
This guide is more appropriate for new installation constraints. If you have been installing for a long time, and have many content files on the website, then there is one additional step to make changes.
The step is to change the siteurl link in the database. To do this, you can first export your .sql file or database via phpMyAdmin, then download the .sql file. After that, open the .sql file with notepad ++ or wordpad. Then change all urls from for example http://namadomain/wp to http://namadomain/.
If you're having trouble moving WordPress files like the guide above you can contact us.