I’ve done this a few times … what you need to do is
1. Download your .htaccess file from the /wordpress/ folder.
1. (preferably using file manager in cpanel as it’s fastest) Copy all the files in the /wordpress folder to the root folder (usually public_html).
2. Go into the wp-admin area (as you would normally do, and under Settings / General, change the URL to the new address. Once this is done you won’t be able to log in to the old area.
3. Change the htaccess file from this
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
To this:
# 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>
# END WordPress
Add this to the file
redirect 301 /wordpress https://yournewurl.com/
redirect 301 /wordpress/ https://yournewurl.com/
4. re-upload this altered .htaccess file to the new (root) directory.
If there are any other index.html files in the root folder, rename them to something like index.html2.
That should do the trick. Open up the site and the admin area with the new address and check that it is working OK.
When you are satisfied, delete the files under /wordpress/ because they’re a duplicate.
Good luck – it’s pretty nerve wracking the first time!