Skip to main content

Configuring multiple sub-domains

Comments

9 comments

  • sparek-3
    The home directories for these two subdomains are /home/exampleuser/public_html/drive and /home/exampleuser/public_html/manage

    These are called DocumentRoots. That will help with terminology better later on. The best solution is to create your subdomains with DocumentRoots outside of the public_html folder, i.e. drive.example.com with a DocumentRoot of /home/exampleuser/drive.example.com manage.example.com with a DocumentRoot of /home/exampleuser/manage.example.com I actually believe this is the default behavior in cPanel when you create a subdomain now. This way your subdomains are not interfered with the .htaccess file in /home/exampleuser/public_html
    0
  • Justin Furnas
    I have the most recent version of cPanel, and when I create subdirectories it doesn't do this. The root it starts at is inside of the 'public_html' directory, and I can't go back to the previous directory. Is there a specific thing I need to configure to fix it so that it works that way, and can I safely reconfigure my current subdomains to use that new structure without breaking them?
    0
  • sparek-3
    What version of cPanel are you using? Do you have root access to this server? Or are you just a cPanel user?
    0
  • Justin Furnas
    Yes, I have full root access. I'm usually very technical, I am just not when it comes to cpanel configuration .
    0
  • sparek-3
    Log into your WHM, click on Tweak Settings, look for the Domains section. Is the option Restrict document roots to public_html on or off?
    0
  • Justin Furnas
    Right now, it's set to 'On'. When changing it, I am able to edit my subdomains to point to /whatever.example.com, except now when doing that I get a 403 error on all of the sites. (After moving the files to the new directory). Nevermind, this appears to have fixed it.
    0
  • cPanelLauren
    Hi @Justin Furnas To confirm disabling Restrict document roots to public_html as suggested by @sparek-3 resolved your issue once you moved the sites? Thank you,
    0
  • Justin Furnas
    It appears to have, yes .
    0
  • cPanelLauren
    Hello, Thank you for updating us @Justin Furnas ! I'm glad you were able to find a solution.
    0

Please sign in to leave a comment.