Skip to main content

Change root directory for the main domain?

Comments

5 comments

  • NOC_Serverpoint
    Hello, For changing the main/primary domain, you will need to have root SSH access and be able to locate and edit the following file (replacing your user & domain info): /var/cpanel/userdata/USERNAME/DOMAIN.COM 1. Once you have opened the file, look for the following line: documentroot: /home/USERNAME/public_html 2. Modify the location according to your needs. Save it and exit. 3. Rebuild the Apache conf and restart Apache: /scripts/rebuildhttpdconf service httpd restart The change will be immediate. Simply clear your browser cache and force refresh the page! Regards,
    1
  • cPanelMichael
    Hello, You will need to reach out to your hosting provider to have them manually update the document root for the primary domain name, using the instructions in the previous post. It's not possible to make this change without root access to the system. Thank you.
    0
  • Ben Taylor
    Hello, For changing the main/primary domain, you will need to have root SSH access and be able to locate and edit the following file (replacing your user & domain info): /var/cpanel/userdata/USERNAME/DOMAIN.COM 1. Once you have opened the file, look for the following line: documentroot: /home/USERNAME/public_html 2. Modify the location according to your needs. Save it and exit. 3. Rebuild the Apache conf and restart Apache: /scripts/rebuildhttpdconf service httpd restart The change will be immediate. Simply clear your browser cache and force refresh the page! Regards,

    I have followed this but still it resolves to old website. I even restarted the entire server and in cPanel > Domain it says the new document root has been applied. There must be another place this needs to be edited?
    1
  • cPRex Jurassic Moderator
    @Ben Taylor - could you start a new thread with specific details on your issue?
    0
  • George_Fusioned
    There must be another place this needs to be edited?

    You also need to change the documentroot line in the /var/cpanel/userdata/USERNAME/DOMAIN.COM_SSL file.
    0

Please sign in to leave a comment.