Skip to main content

File structures in addon domains

Comments

9 comments

  • LostNerd
    Hi, I tend to setup my addon domains in /home/{username}/addon-domains. The folder doesn't exist but you can create it and then have a folder for each domain. That way, it's out of your public_html and out of public view unless they access that domain directly. Hopes this helps.
    0
  • Rezelute
    Thanks for the reply, how do you then make the main domain point to a specific folder? So if "www.test.co.uk" is my main domain, how do i make the "/home/username/www.test.co.uk/" the root directory of the website?
    0
  • LostNerd
    Your main domain will always be /home/{username}/public_html/. This can't be changed. However, addon domains and sub domains can be placed anywhere inside your home directory. If you have another domain, for example test.com with test.co.uk as your main domain, you could either setup test.com as an addon domain which allows you to specify the root folder or as a parked domain which, if parked on test.co.uk will mirror public_html.
    0
  • Rezelute
    Ah ok perfect so just to confirm then, the following structure would be fine as a practise? /home/{username}/public_html/wp-admin + public_html + wp-content + wp-inc etc. And then the addon domain could be pointing to: /home/{username}/test.com
    0
  • LostNerd
    Okay so... test.co.uk - Main Domain Root: /home/{username}/public_html/ Any folders placed in here are accessible via test.co.uk/{folder-or-file} test.com - Addon Domain Root: Anywhere you like, I personally prefer /home/{username}/addon-domains/ As long as the addon domain root folder is NOT in /home/{username}/public_html/, it is not in anyway accessible via your browser on test.co.uk. Only on .com. Your theory is in practice, correct.
    0
  • Rezelute
    Thank you for confirming that, appreciate it!
    0
  • cPanelMichael
    Your main domain will always be /home/{username}/public_html/. This can't be changed.

    Hello :) This thread is helpful if you want to change the document root for the primary domain name associated with the account:
    0
  • LostNerd
    Due to his access level being set as Website Owner, I didn't feel it necessary to let our friend know about this as he would need to be an administrator to make this change, correct?
    0
  • cPanelMichael
    Yes, that is correct. Root access is required to change the document root of the domain name associated with the cPanel account. Thank you.
    0

Please sign in to leave a comment.