Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to change domain extension without duplicating account

Discussion in 'General Discussion' started by speedy200man, Jan 25, 2019.

  1. speedy200man

    speedy200man Member

    Joined:
    Feb 20, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bucharest, Romania
    cPanel Access Level:
    Root Administrator
    Hello!

    I am trying to change a domain name associated with an account and I am not sure what is the right procedure.
    Right now, let's say we talk about domain.com that has a wordpress and some email accounts, totalling about 7 gb of data.
    I want to change the main domain from domain.com to domain.net, without creating a new domain, duplicating data etc

    After the change I would need to make redirects from the old website urls to the new ones, and create the new email addresses @ domain.net

    Is this possible ? What is the best best way to acomplish this?

    Thank you!
    Cezar
     
  2. lorio

    lorio Well-Known Member

    Joined:
    Feb 25, 2004
    Messages:
    294
    Likes Received:
    13
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    Let's say you can change easily from .com to .net, how would you redirect? If com is removed from the account, you cannot redirect. The question is, what should happen to .com in the long run? If .com is not used on a different server or different context, you might just park .net on top of the .com account and do some redirecting. But it all depends on how the old domain will be used. If there is a complete separation, a different approach is needed.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. speedy200man

    speedy200man Member

    Joined:
    Feb 20, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bucharest, Romania
    cPanel Access Level:
    Root Administrator
    I was thinking there is a procedure to change the main domain, and then add the .com as an addon domain and doredirects... Should I create a new one like a standard domain?
     
  4. speedy200man

    speedy200man Member

    Joined:
    Feb 20, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bucharest, Romania
    cPanel Access Level:
    Root Administrator
    I managed to do it. These are the steps:
    1. Make a full backup
    2. Change the website URL in the database from .com to .net (for WP, you can find it in the _options table, usually first 2 records)
    3. Login to WHM - list accounts - modify account - change the domain.com to domain.net (the username needs to remain the same as the previous one, even if you are changing the domain name). Attention: this will automatically modify dns records and change email from @domain.com to @domain.net - i will fix this in the next steps.
    4. Add domain.com to add-on domains.
    5. Login to cpanel account - regenerate Auto-SSL.
    6. Go to domain redirects and create a permanent 301 redirect from the .com domain to the .net domain and check the wildcard redirect before hitting the Add button.
    7. Go to email Forwarders and Add Domain Forwarder from domain.com to domain.net - this will forward emails that come to the old domain.
    8. Login to the WP site, update permalinks and any hardcoded references to the old domain.
    9. Just to be sure, insert a .htaccess rule to permanently redirect old urls to the correspondent new urls.
    Code:
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
      RewriteCond %{HTTP_HOST} ^www.domain.com$
      RewriteRule (.*)$ https://www.domain.net/$1 [R=301,L]
    </IfModule>
    And you're done!
    Cheers!
     
  5. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,502
    Likes Received:
    509
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    This is exactly how you'd do this! Glad you were able to get it done, thanks for adding the steps that worked for you as well.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice