Want to subscribe to topics you're interested in?
Become a Member

Nginx Changing Domain name

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Saahib, Jul 29, 2019.

  1. Saahib

    Saahib Member

    38
    2
    8
    Oct 8, 2017
    Ratings:
    +6
    Local Time:
    11:39 AM
    1.13
    10.2
    Please fill in any relevant information that applies to you:
    • CentOS Version:CentOS 7 64bit ?
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: i.e. 1.17.2
    • PHP Version Installed: i.e. 5.6.40
    • MariaDB MySQL Version Installed: i.e. 10.3.16
    • When was last time updated Centmin Mod code base ? : i.e. run centmin.sh menu option 23 submenu option 2 or cmupdate command
    • Persistent Config: no
    I have need where I need to change domain.com to sub.domain.com , what files I need to change in order to achieve it. I don't want to add new host as "sub.domain.com" and then transfer files to it.


    Kindly advice.
     
  2. EckyBrazzz

    EckyBrazzz Active Member

    917
    190
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +363
    Local Time:
    3:09 AM
    Latest
    Latest
    Can you explain a little more in detail?
    What do you want to transfer, a WordPress installed domain with option 22 to a Subdomain or a domain that you installed with option 2 in the centmin mod menu?

    For example, WordPress needs some db changes and/or in the wp-config.php file.

    There are many things that make a difference when you want to transfer a domain to a subdomain;

    And Yes, you need to create a new host for a subdomain. Centmin configures the new (sub)domain for you as a starter. After that initial step, it depends on what kind of content you want to transfer to your new subdomain, there are different ways to do to get your site working again.
     
  3. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    4:09 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Yeah a bit more background as changing domain name's on nginx vhost can be more involved - especially with wordpress sites which involve database data and config file changes.

    To be 100% sure, he best way is to create a new nginx vhost via centmin.sh menu option 2, 22 or nv and moving the data and files from domain.com to subdomain.domain.com as letsencrypt SSL certs are generated at time on centmin.sh menu run. Changing the server_name and other won't be enough as you'd get invalid SSL certificate errors for mismatched common name/domains listed on SSL certificate otherwise.

    For just Nginx you can see vhost config overview at https://centminmod.com/configfiles.html