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 have an effect on your domain registration: it controls only the hosting. 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.

If you’re using a web application, like WordPress, and it’s not currently managed by 1-click web apps (Installatron), we suggest importing it into 1-click web apps before proceeding.

There are two ways to switch to the new domain: you can directly change the name in Plesk (Option A below) or you can add the new domain to Plesk, clone the website from the old domain to the new domain, then remove the old domain. Please read the notes for each option to understand which is the best choice for you.

Option A: Direct Domain Change

IMPORTANT NOTES:

  • 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.
  • This will automatically change all subdomains to use the new domain. For example, if you’ve got mysub.domain.com and you change domain.com to newdomain.com, the subdomain changes to mysub.newdomain.com.

How to alter the domain in Plesk

  1. Login to Plesk
  2. Find your domain name in the list and click the “Hosting Settings” link underneath
  3. 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.
  4. 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.
  5. Click the OK button to save your changes.

The change may take a few minutes to take effect. The following is a list of other changes you may wish to make now that your domain has changed.

If you want the old domain to redirect to the new one, choose “Add Domain Alias” in Plesk, 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 xyz@olddomain.com will be automatically delivered to xyz@newdomain.com. This is true for all email addresses configured at newdomain.com, which inherently must be the same addresses as which were configured for olddomain.com since you just changed it.

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 commercial/paid certificate, you will need to purchase a new SSL certificate that matches the new domain, and install it manually.

If it’s a Let’s Encrypt free certificate, you’ll need to tell Plesk to generate a new one by following these steps:

  1. 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).
  2. 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.

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.’

If you’re using our 1-click web apps utility (Installatron) to manage your web app like WordPress, it’s best to tell Installatron about the domain change. Here’s how:

  1. Within Plesk, click 1-click web apps (or Installatron)
  2. Click the wrench icon beside the web app installed to the domain you changed. You might then see a warning about exactly this issue — that Installatron can’t find your web app
  3. Choose the Advanced tab
  4. Look for the field that has your website URL in it and select the new domain from the list (if not already selected).
  5. Whether you changed anything or not, press the button at the bottom of the page to save your changes.

WordPress

Attempt to login to WordPress at the new URL. If it redirects you to the old URL, then follow these steps:

  1. Use the Plesk File Manager to edit your wp-config.php file.
  2. After the “define” statements (just before the comment line that says “That’s all, stop editing!”), insert a new line, and enter: define('RELOCATE',true);
  3. Save your wp-config.php file.
  4. Open a web browser and manually point it to wp-login.php on the new server. For example, if your new site is at http://yourdomainname.com, then type yourdomainname.com/wp-login.php into your browser’s address bar.
  5. Login as per normal.
  6. 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.
  7. Important: Once the domain change has been confirmed working, edit wp-config.php and completely remove the line that you added. (This is *very* important for the security of your site).
  8. Go to Plugins > Add New, search for “Better Search Replace” by Delicious Brains and install and activate it.
  9. Go to Tools > Better Search Replace and enter your old URL under “Search for” and your new URL under “Replace with.” Select the wp_posts table and uncheck “Run as dry run” before clicking “Run Search/Replace.” You may wish to keep the dry run option checked the first time just to be sure you’ve entered the right values as this is non-reversible.

Source: how to inform WordPress of your domain name change.

Warning: please take a look at the logs for your domain now and, if you spot open_basedir errors, go here to learn how to fix this with WordPress by removing the upload_path value from the database. This should only occur with apps that were originally installed earlier than ~2017.

Drupal

The Drupal website indicates that no changes should be necessary within Drupal’s configuration.

Magento

Mageplaza has a great guide on this here.

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

Important Notes:

  • 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:

  1. Login to Plesk
  2. Choose the Add Domain button and enter your new domain
  3. 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.
  4. 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.

About Jordan Schelew

Jordan has been working with computers, security, and network systems since the 90s and is a managing partner at Websavers Inc. As a founder of the company, he's been in the web tech space for over 15 years.

3 Comments

  1. Nick on December 1, 2018 at 1:22 pm

    Hello! I wonder if you can help me. I remove an extra www that somebody had added to the website and plesk did not complain. As of yesterday though apache (through plex) throws the following error: “mkdir: cannot create directory ‘/var/www/vhosts/system/MY_SITE.COM/conf’: No such file or directory mktemp: failed to create file via template ‘/var/www/vhosts/system/MY_SITE.COM/conf/httpd.conf.XXXXXX’: No such file or directory Can not create temporary file”. Please note that in /var/www/vhosts/system/ I still have http://WWW.MY_SITE.COM and in /var/www/vhosts/ I have both the WWW and the new folder, but the site content is still in the WWW. Any clue as to how to fix this? Plesk tells me to contact people who sold the license who, in return, say can’t do anything because it’s a dedicated server somewhere (please note, not my site, I’m just managing WordPress). Anything would help!

    • Jordan Schelew on December 1, 2018 at 1:35 pm

      Hey Nick!

      If the Plesk UI thinks the domain no longer has the www then rename /var/www/vhosts/system/www.domain.com to /var/www/vhosts/system/domain.com to fix that up. Be sure to check ownership and permissions of the folder to ensure it matches other vhost folders in the /var/www/vhosts/system directory.

      You may also then need to move the content into the non www folder under /var/www/vhosts (not system).

      Cheers,

      Jordan

      PS: If you’re considering a switch if only for the existing host’s lack of support, we’d love to have you host with us!

      • Nick on December 1, 2018 at 4:05 pm

        Thanks for the quick answer. What would happen to all the configuration files (e.g. the ones in /var/www/vhosts/system/www.domain.com/conf/httpd.conf and siblings – especially httpd_ip_default.conf – and /etc/httpd/conf/plesk.conf.d/vhosts/www.MY_SITE.COM.conf) ? Would they – hopefully – get automatically updated? Because as now they all have the old www and http://www.www values in them…
        And, thanks for the offer but as I mentioned it’s not my choice to make 🙂

Leave a Comment