How to Change the Domain Name for your WordPress Based Website

3. Add new domain to Web Host Account

  1. Login to cPanel, click on Add On Domains
  2. Use the “Password Generator” to create the password. It will not be used for anything.

Update Nameservers for the new domain

  1. Get the nameserver address for your domain.
    1. Highly recommend to use Cloudflare. How to setup cloudflare for wordpress.
  2. Go to Dotster and update the Nameservers for the new domain
    1. Link for how to update nameservers for different domain registrars.

4. Update the Site Address (URL) within WordPress

  1. Enter the new domain name in the field named Site Address (URL)

 

 

5. Create a new file named index.php in the folder for the new domain

  1. Use FTP, or the file manager within cPanel to navigate to the new folder that was created for the new domain name. In this example, the folder name for the new domain name is: MontecitoCondos
  2. Create a new file named index.php

6. Update the index.php file

  1. Paste the following code into the file:<?php

/**
* Front to the WordPress application. This file doesn’t do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/

/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define(‘WP_USE_THEMES’, true);

/** Loads the WordPress Environment and Template */
require(‘/home/sbbeac5/public_html/WordPress-Directory-for-New-Website/wp-blog-header.php’);

2. Update the name of the folder to the folder where the website was originally installed. In this example, WordPress was originally installed in the folder named bonnymedecondos.com.

a. Find this line:

require(‘/home/sbbeac5/public_html/WordPress-Directory-for-New-Website/wp-blog-header.php’);

b. Change “WordPress-Directory-for-New-Website” to the directory where where WordPress was installed:

require(‘/home/sbbeac5/public_html/bonnymedecondos.com/wp-blog-header.php’);

 

Save Changes in Editor. Then Close the Editor

7. Create a new file named .htaccess in the folder for the new domain

  1. Use FTP, or the file manager within cPanel to navigate to the new folder that was created for the new domain name. In this example, the folder name for the new domain name is: MontecitoCondos
  2. Create a new file named .htaccess 

8. Update the .htaccess file

  1. Add the following code to the .htaccess file:# 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

9. Clear the Cache in your browser and reload the website using the new domain name