How To Switch Website From Subdomain To Main Website using Cpanel

H

You had used a staging website and now looking to migrate the subdomain to the main domain then you are at the right blog post. Businesses often need to redesign their websites to enhance organization, advertising, or search engine optimization in the constantly changing world of digital presence. So changing the subdomain to the main domain and vice versa is usual while maintaining a WordPress website. At the end of this article, you will understand how to migrate a website from a subdomain to the primary domain.

What is a Subdomain?

The extension of your primary domain name is called a subdomain. For Instance, a subdomain of example.com is http://yourwebsite.example.com. Example.com is the root domain in this particular case.

The subdomain is considered by search engines as a completely distinct website. For this purpose, after the transfer, you have to make sure that search engines are properly directed to the root domain. By doing this, you may preserve the search engine rankings of your website after transferring.

What to do before you change the subdomain to the main domain?

Like moving a website to a new host or domain, you can transfer WordPress from subdomain to root either the easy way via a plugin or the hard way by doing it yourself. I’ll cover both approaches in this article. It’s a good idea to take a few steps before starting the migration:

  • Back up your entire site, i.e., the WordPress files and databases for both the subdomain and the root domain. If anything goes wrong during the migration, you can revert to a fully functional version of your site and start again.
  • Clear everything cached by any caching plugins that you use, then disable said plugins as they can cause issues during migration. Re-enable them on your site after the migration is complete.
  • Put your site in maintenance mode using a plugin like Themeisle’s WP Maintenance Mode & Coming Soon. It will ensure that nobody can make real-time changes to your site during the migration process, which can cause errors. This is especially useful if you run a WooCommerce store.
  • Disable any firewall and redirection plugins. Such plugins, like caching plugins, can cause issues during migration.
  • Obtain the FTP credentials of your web server from your web host.

7 easy Steps on how to switch website from subdomain to main website using cPAnel

Here are steps to follow to switch the subdomain to the main website using cPanel

1- Go to your cPanel Dashboard→ File Manager:

Cpanel file manager

2- After Opening File Manager in cPanel, Now open public_html directory:

3- Open the subfolder inside the public_html directory (in our case, it is WordPress):

4- Here you have access to all the website’s files, click the Select All button:

cpanel file m,anager

5- Right-click one of them and select Move:

index php

6- Specify the location where you want to move these selected files. For the main domain of your account, this is /public_html, and click on Move Files:

public html

7- After moving files, navigate back to /public_html and remove any remaining files and folders, (in our example, wordpress-5.8.1.zip, and the WordPress folder).

Access your website after clearing the cache and check that everything works correctly.

Troubleshooting issues after the migration:

Even if transferring a website from a subdomain to the main domain is an easy process, there may be some problems following the transfer. We’ll list a few of the most typical ones here, along with solutions:

  • HTTP 500 ERROR: The HTTP 500 internal server error, which is famous for being difficult to identify and resolve, indicates that the server that is hosting your website is having issues and is unable to retrieve your website. Before you start, turn off any firewalls and caching plugins to reduce the likelihood of running into this issue. If you are unfortunate enough to receive this problem, please go to the troubleshooting guide for assistance.
  • Error establishing database connection: Usually, incorrect credentials in the wp-config.php file are the source of this issue. Verify that the settings for table_prefix, DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST are accurate. see more About Database Connection Error

Conclusion:

A website’s transfer from the subdomain to the main domain is an undertaking that needs thoughtful planning, following, and management. Businesses may successfully navigate the shift while preserving SEO equality, enhancing the user experience, and meeting their business objectives by following the detailed instructions given in this article.
Moving to a digital environment may open up fresh opportunities for growth, visibility, and success with adequate preparation and efficient management.

FAQs:

What is better for SEO: a subdirectory or a subdomain?

Our content should be hosted on our main domains unless there is an excellent reason not to. Putting content in subdirectories on your main site is the best option for the structure and long-term SEO, even if Google is correct and your performance is affected.

What is the purpose of a subdomain?

A prefix applied to a domain name to separate an area of your website is called a subdomain. Subdomains are mainly used by website owners for managing large parts, like online companies, blogs, job boards, or support platforms, which require their content hierarchy. Subdomains exist independent of their parent domain as a website.

Is it possible to change the WordPress website’s domain?

Go to Upgrades → Domains to change the primary domain of your website. Next to a domain, click the † and select “Make primary address.” Optional: You have the option to maintain your primary domain or cancel it.

Are subdomains bad for SEO?

Although they’re not inherently detrimental to SEO, subdomains aren’t always the best option. Subdomains are tracked and crawled independently from subdirectories, according to Google, but they are both acceptable.
Regarding SEO elements like link equity, your subdomain is probably going to be on its own and won’t likely transfer link equity to your primary domain either.

About the author

Editorial Team

Add Comment