This question is asked frequently! Sometimes it’s simply because there’s an error when the account was created and other times it’s because the company’s brand name has changed. Regardless of the specific reason for the change, this guide will show you how to change your domain name if you’re hosted with us or otherwise using Plesk control panel.
Important Note: changing your domain in Plesk does not register the domain. If you haven’t already done so, please make sure you register the new domain name first and ensure that the new domain points to your hosting plan. Registration and DNS changes can take 24-48 hours to propagate throughout the Internet so be sure to wait a day or two before proceeding with the changes below.
IN THIS ARTICLE
Option A: Direct Domain Change
- This is your only option if the domain you’re changing is your primary domain.
- This will automatically change all email accounts you have configured in Plesk to use the new domain. This means any mail apps you have configured to log in and sync your mail will need their usernames updated by replacing the old domain with the new one. Tip: you can alias the old domain to the new one to ensure mail flows through to the new accounts. Instructions are found below.
- This will automatically change all subdomains to use the new domain. Example: you have subdomain mysub.domain.com, you change domain.com to newdomain.com, and the subdomain changes to mysub.newdomain.com.
- If both the current and the new domain are already hosted in Plesk and you would like to change the primary domain in Plesk to the addon domain, keeping the website hosted at the addon domain, there’s a few extra steps you must complete. Please see our guide to switching your primary domain here.
- If your website is powered by a web app like WordPress, make sure it appears under 1-click web apps in Plesk for our domain change automation to work. If it does not, import it now, then come back here to proceed with the domain change.
How to change the domain in Plesk
- Login to Plesk
- Find your domain name in the list and click the “Hosting Settings” link underneath
- The very first option on this page is Domain Name: and your current domain name will appear in that field. You can directly edit this value to change it to the new domain.
- If you wish to change the document root value, you’ll need to then move the contents of the old document root folder to the new folder after completing these steps. It’s simpler to not change it.
- If you have an SSL certificate activated on the domain, be sure to deselect it under the Security section on this page by choosing “Not Selected” from the Certificate drop down.
- Click the OK button to save your changes.
- If you want the old domain to redirect to the new one: choose “Add Domain Alias” and enter the old domain. Select the destination to be the newly renamed domain. By default all necessary boxes are checked. Mail aliasing will ensure that any emails sent to firstname.lastname@example.org will be automatically delivered to email@example.com. Read more about aliasing here.
These changes may take a few minutes to take effect. The following is a list of optional things you may wish to do now that your domain has changed.
Tip: as of Feb 2021, if you’re hosted with us and using WordPress on a shared server, all the changes below are now automatically completed for you when you change your domain. If you have a VPS with Hands-On Support, ask us to install this automation before you complete your domain change. If you’re using any other web app to power your site, you may wish to check below for next steps.
Need a new SSL Certificate?
If you had an SSL certificate for the old domain name, it will not match the new domain and so it won’t function properly after the domain change.
If it’s a Let’s Encrypt free certificate, you’ll need to tell Plesk to generate a new one by following these steps:
- Remove old certificate: Under the new domain in Plesk, Choose ‘SSL Certificates’ then remove the Let’s Encrypt certificate that matches the old domain. (Tip: if you did not complete step 4 above, you will not be able to remove the certificate, so go back and do that, then try this step again).
- Generate a new certificate: Once removed, under the new domain, click the “Let’s Encrypt” button and proceed with installing a new certificate. If you added the old domain as an alias, you should get the option to include the alias when creating the new certificate. It’s recommended to cover both domains when the option is available.
Adjust your Website Config or Code
Changing the domain name might cause problems within the web app because it doesn’t know about the name change: this is the website equivalent of ‘pulling the rug out from under it.’
Attempt to login to WordPress at the new URL.
If it redirects you to the old URL, then follow these steps:
- Use the Plesk File Manager to edit your
- After the “define” statements (just before the comment line that says “That’s all, stop editing!”), insert a new line, and enter:
- Save your wp-config.php file.
- Open a web browser and manually point it to
wp-login.phpon the new server. For example, if your new site is at
http://yourdomainname.com, then type
yourdomainname.com/wp-login.phpinto your browser’s address bar.
- Login as you normally do.
- Look in your web browser’s address bar to verify that it has not redirected you back to the old domain: if it did redirect you to the old domain then try the steps again.
- Important: Once the domain change has been confirmed working, edit
wp-config.phpand completely remove the line that you added. (This is *very* important for the security of your site).
The above steps update the WordPress Site URL value in the database, however there are other resources that have the URL hard-coded elsewhere in the database as well. Therefore, once you have regained access to the WordPress admin at the correct new URL, you must follow the steps here to find/replace the URL throughout your database.
Warning: please take a look at the logs for your domain and, if you spot open_basedir errors, learn how to fix this with WordPress by removing the upload_path value from the database.
The Drupal website indicates that no changes should be necessary within Drupal’s configuration.
Other web apps
You can probably find similar solutions for other content management systems with a quick Google search. If you do not find such a guide for your web app, do a global search for all instances of the old URL in the database and replace it with the new URL. Then do the same for all files, paying specific attention to config files.
Option B: Add new domain, remove existing
- This option will not work if the existing domain name is your primary domain. You cannot remove your primary domain. You must use Option A if this is your primary domain.
- This option will also not work if you have our Carbon or Helium hosting plan as you can only host one domain (which therefore must be your primary domain).
- This option will not change the domain you use for email.
Here’s how to use Plesk to add a new domain and copy your website to it:
- Login to Plesk
- Choose the Add Domain button and enter your new domain
- Copy your website
- If you have static content (ex: html files), you can simply use the Plesk File Manager to select all files in the domain web root for the existing domain, then move them to the web root for the new domain
- If you’re using WordPress or any other app in our 1-click web apps manager, you can use this guide to clone your site from the old domain to the new one.
- Remove the old domain in Plesk. This option will not be available if it’s your primary domain, which is why we recommend ‘Option A’ in these cases.