Changing your WordPress website location

If you want to change the location of your WordPress website, this tutorial will guide through the process. The same settings will apply when moving from a Subdirectory/Folder as well as from your Root/Public_html Location.

You will also want to read:

Automatic Update in WordPress

7 Security Tips for a WordPress Website

Configuring the basic settings in your WordPress website

How to Backup Your WordPress Website Automaticaly Using Backup Plugins

How to Fix a Hacked WordPress Website

Please be aware that following the instructions below will cause your site to be inaccessible for a short period of time leading to "Error 404 – Page Not Found" until all the steps are completed.

1. You will need to login to your WordPress Admin Panel.

Example: http://www.todhostdemo.com/wordpress-location/wp-admin

2. Once you are logged into the Admin page you will need to click on the Settings Tab followed by General:

3. You will now see the two fields which state Site Address (URL) and WordPress Address (URL), This will show you current Location of WordPress in a Full URL, Here is where you will change to the location of your choice for example:

From a Subdirectory to public_html:
http://www.todhostdemo.com/wp-location/ would be changed to http://www.todhostdemo.com/
From public_html to Subdirectory:
http://www.todhostdemo.com/ would be changed to http://www.todhostdemo.com/wp-location/
From Subdirectory to Subdirectory:
http://www.todhostdemo.com/wp-location/ changes to http://www.todhostdemo.com/new-location/

Also read:

How to Install and Setup Your Premium WordPress Theme

How to Keep Your WordPress Website Updated

How to Manage 403 Forbidden Error in WordPress

How to Optimize and Speed Up Your WordPress Website

How to Secure a WordPress Website

4. Once this is completed you will need to click Save Changes, please do not attempt to access your WordPress site now, as it should show you a ‘404 Not Found Error,’ this is because your new location is setup but the files have not been moved.

5. If you are using FTP to move the WordPress files, please go to step 5a, if you wish to move the WordPress files via File Manager please go to Step 5b.

5a. You will need to access the website via FTP. Once you are connected you will need to go to the location of your WordPress Installation and move all the files within the directory to the new location specified within the WordPress Admin URLS.

5b. You will need to Login to SiteAdmin > Website Tools > File Manager. Once within File Manager you will need to go to the location of your WordPress installation and select all files by click on the select all Icon on the top toolbar. You may then Click on the Move Icon and Specify the location for it to be moved too or just drag and drop in desired location. If you choose to drag and drop, please be very careful not to empty your content into the wrong folder.

6. Once all files have been Moved, you may then test this by going to the new URL location you specified as well as testing the Admin Login Page.

Also read:

How to create a simple portfolio website with WordPress

How to create and manage a page in WordPress

How to safely disable the WordPress automatic update feature

How to update your WordPress installation

Configure your WordPress to use its original domain

If you have configured your WordPress site to use a temporary url, this article will show you how to get the site to use its original url.

1) Login to your website or cPanel

2) Proceed to the File Manager by clicking the File Manager link found in the Website Tools section of the left menu.

3) Navigate to the location where your WordPress is installed. In this article, our WordPress is setup to work with a sub-domain.

4) Locate the wp-config.php file and open it using the code editor.

6) Remove the following lines near the top of the file (after the <?php tag)… once done, click save changes.

define(‘WP_HOME’,’yourtempdomain.com‘);
define(‘WP_SITEURL’,’yourtempdomain.com‘);

You now have the option of removing any domain you added before if you so wish.

Also read:

The Many Uses to Which You Can Put Your WordPress Website

What you should know about optimizing your WordPress website for speed

WordPress Search Engine Optimization Tutorial

Direct fix for WordPress installation error: IndexOf Listing Error

If you are trying to install WordPress Direct and get the IndexOf listing error or an incomplete installation, try the following steps to resolve this:

Access the .htaccess file in the WordPress folder (in the public_html folder if installed on the primary domain).
From cPanel home, in the Files section, click the File Manager icon.
Select Web Root (public_html/www) and check the box for Show Hidden Files.
In the File Manager, the .htaccess file will generally be the first file located beneath the folders.
Delete the default.html page from your public_html folder before you attempt the install.
After removing the default.html page, attempt the WordPress Direct installation again.

If you only see IndexOf after installing WordPress, you need to add the following line to the .htaccess file: DirectoryIndex index.php

Your WordPress should now work rightly. If you still have any issues with this, please contact customer support


How to remove builder and move WordPress to the main folder

You will need to follow these steps to removing builder and move Wordpress to the main folder

Make a Backup of your account
As a good practice, it is always a good idea to make a backup of your account prior to making any changes. Ideally you will not need this, but it is extra insurance 'just in case'. Below is a link on making a backup of your cpanel account.

Removing the Premium Website Builder site files
After you have created your insurance backup, you will want to remove the files for your Premium Website Builder site. The basic instructions of removing the site can be found in the link below. Although you do not have to worry about any files that are for the builder site as the builder tool keeps a copy on the publishing server, when you are deleting the files, be sure that you do NOT delete the folder that contains your Wordpress site. Deleting that will destroy the Wordpress version and you will have nothing with which to move on to the next step.

Prepare your Wordpress installation for the move
Prior to physically moving the files, you will need to prepare the installation to accept the new URL name.

Log into your WordPress Admin Dashboard. For example.
Go to Administration -> Settings -> General
Look for the WordPress address (URI): and change it from (example.com/wordpress to example.com)
Look for the Site Address address (URL): and change it from (example.com/wordpress to example.com)

Moving your Wordpress from a subfolder to your main folder
After you have made your backup, removed the site files from the builder, and prepared your wordpress files, it is time to move your WordPress to the primary folder.

  • Log into your cPanel admin dashboard.

From the main cpanel area, look for the Files category and then click on the File Manager tool. Ensure you select the checlbox entitled Show Hidden Files.
Once inside the File Manager, you will want to navigate to the folder you have the WordPress site in. For example, a folder named wordpress.
You will see a list of all the wordpress files and folders in the right hand panel. Highlight them all and click on the Copy icon from the menu toolbar across the top of the page.
A popup will appear so you can enter the destination folder. Continuing with our wordpress folder example, it should show as public_html/wordpress. Remove the /wordpress from the destination path so that it simply displays as public_html. Click the Copy Files button.
This will copy the files up to the public_html folder. Use the File Manager to navigate back to the public_html folder. (You can do this by clicking on the Up One Level button from the toolbar across the top of the right hand panel.)
You should now see the same files as you have in your wordpress folder.
You can now delete the old wordpress folder.

  • Log in and finish the URL details


Log into your NEW WordPress admin dashboard. For example (example.com/wp-admin or example.com/wp-login.php)
Go to Administration -> Settings -> Permalinks and ensure the link structure is the same as your new URL.

WordPress preventing password protecting a directory?

There are times when WordPress configuration could prevent you from password protecting a directory. This tutorial will show you how to fix this issue. Password protecting a subdirectory using the cPanel icon (or a .htpasswd file) will be unsuccessful if WordPress is installed in the public_html directory with permalinks enabled.

To fix this issue will involve editing the .htaccess file. Before making any changes to your .htaccess file, it is suggested that you backup your website so that you can revert back to a previous version should something go wrong.

Edit .htaccess File

Edit the .htaccess file in your WordPress home folder (public_html) and remove the line of code shown in bold below:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Replace that line with this new line:

RewriteRule ./ /index.php [L]

The final code snippet will look like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ./ /index.php [L]
</IfModule>
# END WordPress

Save your changes.

Reset Permalinks

From the left-hand navigation menu in WordPress, click Settings > Permalinks. Note the current setting. If you are using a custom structure, copy or save the custom structure somewhere.

Select Default.
Click Save Settings.
Change the settings back to the previous configuration (before you selected Default). Put the custom structure back if you had one.
Click > Save Settings.

This should reset the permalinks and prevent any posts or pages from returning a 404 Page Not Found error. You should now be able to password protect a subdirectory.

  • 3 Users Found This Useful
Was this answer helpful?

Related Articles

How to create and manage a page in WordPress

Creating pages in WordPressCreating individual pages in WordPress is quite similar to writing a...

Configuring the basic settings in your WordPress website

This tutorial shows you how to configure the basic settings of your WordPress website. This...

How to create a simple portfolio website with WordPress

Installing WordPress on Todhost is simple and easy. It is part of our free software fould under...

How to control new user registration in WordPress

One problem plaguing WordPress especially membership sites that take user registrations is spam...

How to modify search features of your WordPress website

You will need to modify the search features of your WordPress website once you start writing and...