File structures in addon domains
Hi,
I am still fairly new to cPanel so excuse my stupid question (I have done alot of searching on google and this forum but cant really find my exact answer). From what i understand, public_html is the root directory of my main domain website which could contain the following for example: public_html/wp-admin, public_html/wp-content, public_html/wp-inc etc.
If I wanted to create an addon domain, I might setup the following: public_html/MyAddonSite.co.uk/ and then I point the addon to the newly purchased domain (MyAddonSite.co.uk). My issue with this is that the main website would look slightly cluttered with folders of the main domain and then the addon domains as such:
public_html/wp-admin, public_html/wp-content, public_html/wp-inc, public_html/MyAddonSite.co.uk.
Is this the only way of setting up multiple websites on one host? Might it be possible for example to either have MyAddonSite.co.uk outside the public_html directory or have two seperate websites in the public_html as such: public_html/MainWebsite.co.uk, public_html/MyAddonSite.co.uk.
Thank you for the clarification!
-
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 -
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 -
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 -
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 -
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 -
Thank you for confirming that, appreciate it! 0 -
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 -
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.
Comments
9 comments