Changing the primary domain name
of a hosting account has certain consequences. These depend mostly on the type of hosting account you have. This article covers what you’ll need to keep in mind after requesting this change within our
Shared Hosting servers.
You may also find this guide useful if you are using EasyWP:
How to change domain for a WordPress site created with EasyWP.
As an example, we will reference screenshots of a cPanel account with the following setup:
- cPanel username: cpuser
- Primary (main) domain: domain1.tld with the document root /home/cpuser/public_html
- Addon domain: domain2.tld with the document root /home/cpuser/domain2.tld, will be used as the new primary domain
- Addon domain: domain3.tld with the document root /home/cpuser/domain3.tld
- Alias domain: domain4.tld with the document root /home/cpuser/public_html (default for Alias/Parked domains)
- FTP accounts: ftp1@domain1.tld, ftp2@domain2.tld, ftp4@domain4.tld
- Email accounts: mailbox1@domain1.tld, mailbox2@domain2.tld, mailbox4@domain4.tld
- Mailing lists: mailinglist1@domain1.tld, mailinglist2@domain2.tld, mailinglist4@domain4.tld
In this case, the primary domain of the cPanel account “cpuser” is changed from domain1.tld to domain2.tld. The post-change changes are as follows, including troubleshooting guidance:
| Document root before the change
| Document root after the change
|
---|
domain1.tld (old primary domain)
| /home/cpuser/public_html
| (domain is removed from the cPanel account)
|
domain2.tld (new primary domain)
| /home/cpuser/domain2.tld
| /home/cpuser/public_html
|
domain3.tld (another addon domain)
| /home/cpuser/domain3.tld
| /home/cpuser/domain3.tld
|
domain4.tld (another alias domain)
| /home/cpuser/public_html
| /home/cpuser/public_html
|
Up-to-date information about the existing configuration of document roots can be checked using the
cPanel >> Domains menu
:
Troubleshooting: new primary domain name directs to the parking page instead of the website.Ensure the domain name has been pointed to the hosting server. View the video for guidance:
How to connect a domain name to your Shared Hosting. Also check out the
illustrated guide.
Alternatively, you can
point the domain to its hosting server
by setting up a Type A DNS record for the domain, using the server IP as its value.
Troubleshooting: new primary domain name displays the content of the previous domain.Files within the document root
/home/cpuser/domain2.tld are not moved to
/home/cpuser/public_html automatically during the primary domain change. Website-specific files need to be moved or copied manually. View these guides to complete the process:
cPanel >> File Manager menu
or
FTP access to the hosting server.
Troubleshooting: Website Builder does not display expected content.If your website is built with Namecheap’s free
Website Builder, you’ll need to
create the website's backup
first then restore it manually after the main domain change is complete.
Troubleshooting: previous primary domain name does not display any content or shows an error message.Your old primary domain (
domain1.tld) will get disconnected from your hosting account during the change. If you want to retain domain1.tld within the same cPanel account, you’ll need to reinstate it as an
Addon Domain (ensure the new document root is correctly setup) or
Alias/Parked Domain (it will be pointed to the document root
/home/cpuser/public_html automatically).
URL references
Changing the primary domain of a hosting account affects server-side configuration only. In case the website is set up to use
domain1.tld as its URL within the internal settings, configuration files, database, etc., these references will
not be changed to
domain2.tld automatically.
Troubleshooting: new primary domain name redirects to the previous domain.The redirect might have been retained within the configuration file /home/cpuser/public_html/.htaccess. The
cPanel >> File Manager menu and its View/Edit feature will help you trace the redundant redirect setup and remove/disable it.
Troubleshooting: WordPress-based website redirects to the previous domain.Your WordPress site’s URL needs changing to match the primary domain change. Make the update using the
WordPress Admin Dashboard
or via
direct database access.
Troubleshooting: non-WordPress Content Management System (CMS) or custom website framework keeps redirecting to the previous primary domain.Each CMS has its own location for configuration files. The following list of popular CMS platforms provides their locations. Ensure the configuration files match the database connection setup. If the CMS or framework of your website is not listed below, contact your site platform provider or refer to the software specifications.
Content Management System (CMS)
| Default location of the configuration file
|
---|
AbanteCart
| /system/config.php
|
Concrete5
| /application/config/database.php
|
CubeCart
| /includes/global.inc.php
|
Dolphin
| /inc/header.inc.php
|
Drupal
| /sites/default/settings.php
|
Joomla
| /configuration.php
|
Magento 1.x
| /app/etc/local.xml
|
Magento 2.x
| /app/etc/env.php
|
myBB
| /inc/config.php
|
OpenCart
| /admin/config.php and /config.php
|
phpBB
| /config.php
|
PrestaShop
| /config/settings.inc.php
|
SMF
| /Settings.php
|
WHMCS
| /configuration.php
|
FTP accounts
Although the new domain first needs to be removed from the hosting server before setting it as the primary domain, FTP accounts of domain2.tld are retained during the process. FTP accounts of domain1.tld will be reassigned to domain2.tld usernames, but their paths cannot be changed.
FTP accounts of other hosted domains will not be affected during the process. Here is a summary:
| FTP account before the change
| FTP account after the change
|
---|
domain1.tld (old primary domain)
| Username: ftp1@domain1.tld Path: /home/cpuser/domain1.tld
| Username: ftp1@domain2.tld Path: /home/cpuser/domain1.tld
|
domain2.tld (new primary domain)
| Username: ftp2@domain2.tld Path: /home/cpuser/domain2.tld
| Username: ftp2@domain2.tld Path: /home/cpuser/domain2.tld
|
domain4.tld (another alias/addon domain)
| Username: ftp4@domain4.tld Path: /home/cpuser/domain4.tld
| Username: ftp4@domain4.tld Path: /home/cpuser/domain4.tld
|
Troubleshooting: previous FTP accounts do not work at all or provide access to the incorrect server directory.The current setup of existing FTP accounts can be confirmed using the
cPanel >> FTP Accounts menu. From this menu you can also revise the configuration of existing accounts or create new ones.
You may find the Log In (FTP username) values change after the primary domain of the cPanel account has been changed.
Email accounts
Mailboxes of
domain1.tld will be removed from the list in the
cPanel >> Email Accounts menu. But their content will remain in the server directory
/home/cpuser/mail/domain1.tld/mailbox1.
If
domain2.tld was present in the cPanel account before the primary domain name changed, its mailboxes will be retained and functional after the change is applied. Here is a summary:
| Mailbox before the change
| Mailbox after the change
|
---|
domain1.tld (old primary domain)
| mailbox1@domain1.tld
| (mailbox is removed during the change; its content is retained within the directory /home/cpuser/mail/domain1.tld/mailbox1 )
|
domain2.tld (new primary domain)
| mailbox2@domain2.tld
| mailbox2@domain2.tld (mailbox is re-created automatically)
|
domain4.tld (another alias/addon domain)
| mailbox4@domain4.tld
| mailbox4@domain4.tld (mailbox is not affected)
|
Troubleshooting: email accounts are missing after the primary domain name changed.
An up-to-date list of existing mailboxes can be viewed using the cPanel >> Email Accountsmenu. If any mailboxes are missing, the same menu can be used to recreate them.
Troubleshooting: email accounts exist after the primary domain change, but no emails are seen in the Webmail interface.
The content of previous mailboxes can be restored from the full cPanel backup. View the
email-specific section
of the backup restoration article to help you with the process.
Contact lists
Contacts from the address book of the @domain1.tld email accounts cannot be reassigned to the new domain @domain2.tld during the change of the cPanel account’s primary domain name.
Troubleshooting: contact lists are missing after the cPanel account’s primary domain name has been changed.
Export the required contact lists prior to changing the primary domain of the hosting account, then import them back afterward if needed.
Mailing lists
During the primary domain change, any mailing lists based on the old primary domain are re-assigned to the new primary domain. If the new primary domain was added to the cPanel account previously and had mailing lists created for it, those will be retained after the change. Here is a summary:
| Mailing list before the change
| Mailing list after the change
|
---|
domain1.tld (old primary domain)
| mailinglist1@domain1.tld
| mailinglist1@domain2.tld
|
domain2.tld (new primary domain)
| mailinglist2@domain2.tld
| mailinglist2@domain2.tld (mailing list is re-created automatically)
|
domain4.tld (another alias/addon domain)
| mailinglist4@domain4.tld
| mailinglist4@domain4.tld (mailing list is not affected)
|
Troubleshooting: mailing lists based on the previous domain name malfunction after the primary domain name was changed.Previously created and managed mailing lists can be reinstated using the cPanel >> Mailing Lists menu. View
How to create and manage mailing lists in cPanel
for help with completing this process.
SSL certificates
If you have an
SSL certificate installed for your current primary domain (
domain1.tld), it cannot be transferred automatically to the new domain name (
domain2.tld). But if the SSL certificate was ordered with us, it can be
re-issued for the new domain name
directly through the Namecheap Dashboard. Contact our
SSL team
if you need any further help.
In some cases, the SSL certificate can be reissued and reinstalled in just a couple of clicks using the
cPanel >> Namecheap SSL menu.
Troubleshooting: the URL of the new primary domain name shows up as not secure.Check the current status of the certificate using the
SSL Checker Tool. If it displays issues, they can be resolved by installing or reissuing the certificate for the new domain name using the
cPanel >> Namecheap SSL menu.
Backup creation/restoration via Softaculous
In some cases,
creating
or
restoring
backups using the
cPanel >> Softaculous Apps Installer menu may not work as expected for the domain/subdomains involved, during the primary domain name change.
Troubleshooting: backups generated using the Softaculous tool don’t contain the expected data after the primary domain of the hosting account was changed.
This happens because the Softaculous backup tool continues creating backups using the previous configuration of the domain’s document root. So the domain names document roots in the Softaculous configuration files will need updating.
The easiest solution is to remove the installation from the Softaculous and
re-import
it afterward:
Troubleshooting: unable to restore a previously created backup using the Softaculous tool.The previously generated backups may be listed with the warning “Installation which was installed on the
http://domain2.tld URL has been removed. You can restore it using the Backup”.
We recommend avoiding the automatic restoration of these backups as they may overwrite important information. It’s best to do a manual download of the backup file for restoration. View
How to Restore a Backup on a New Server
for help with the process.
Private nameservers (for Reseller Hosting packages)
Private nameservers for your current primary domain name (for instance,
ns1.domain1.tld and ns2.domain1.tld) cannot be transferred to the new one. You’ll need to register new private nameservers (for instance,
ns1.domain2.tld and ns2.domain2.tld) and repoint the resold domains accordingly.
Troubleshooting: domain names are pointed to custom nameservers ns1.domain1.tld and ns2.domain1.tld, but stopped working after the primary domain of the hosting account was changed.If the previous primary domain
domain1.tld is removed from the hosting account during the change, previously registered private nameservers lose their DNS records. All domain names that use
ns1.domain1.tld and
ns2.domain1.tld as their custom DNS will no longer be pointed to the hosting server where their DNS zone files exist.
The easiest solution is to create a new set of private nameservers for the new primary domain. Such as:
ns1.domain2.tld and
ns2.domain2.tld,
registering corresponding glue records
and
setting up the required subdomains
using the cPanel/WHM menus.
NOTE: domain names pointed to
ns1.domain1.tld and
ns2.domain1.tld will need to be re-pointed to
ns1.domain2.tld and
ns2.domain2.tld after these changes.
WHMCS license (for Reseller Hosting packages)
If you have the licensed WHMCS software installed for the existing primary domain name, changing this domain name will require updating the license for it to match the new setup.
Troubleshooting: WHMCS software shows the warning “Your license key is invalid” after the primary domain change.If the WHMCS license was ordered with us, our Hosting team can reissue the license for you via
Live Chat
or within through tracked
email Support.