SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Dec 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Very newbie question about organizing cPanel and directories

    I apologize if this is in the wrong forum section as I could not find a cPanel section

    What is the purpose of the main domain? I have a hosting plan with HostGator that allows unlimited domains, and therefore, I can host unlimited websites by create add-on domains. Wouldn't it be disorganized if I built a website on the main directory for that main domain, then build several other websites on add-on domains? Add-on domains are added as subdirectories in the main directory.

    So, the reason why I ask this is, how do people organize their cPanel? Do they leave the main directory alone, and just focus on the add-on domain directories? I'm probably not using proper webhosting terms so I hope I'm not confusing anyone

  2. #2
    SitePoint Wizard bronze trophy bluedreamer's Avatar
    Join Date
    Jul 2005
    Location
    Middle England
    Posts
    3,349
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The main domain is the one your account uses and is normally mapped to files in /public_html

    For addon domains the normal method is to create a folder inside /public_html such as /public_html/mysite.com (indeed this is what happens when you add a new site in Cpanel>Add domain)

  3. #3
    SitePoint Member
    Join Date
    Dec 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    but i'm still confused to the purpose of the main domain. Why do I need a main domain? I can make a website out of it, but I can also make websites out of add-on domains.

    Let's say ABC123.com is set as the main domain, but would it make more sense to make a subdirectory "ABC123" ( /public_html/ABC123) instead of building that site directly into /public_html? Because what if I want other different websites in the future, then they'd all be add-on domains and add-on directories

  4. #4
    SitePoint Zealot WebEminence's Avatar
    Join Date
    Jan 2012
    Location
    Chicago, IL
    Posts
    129
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I understand your confusion. Cpanel needs to have a main domain associated with your account. You could buy an extra domain for the main domain and make all your other sites as add-on domains. Not sure what the point of that would be except to make it more organized in your mind.

    The add-on domains are added in sub directories as bluedreamer said. It seems disorganized but it really doesn't matter because no one is going to see this folder structure. They will only see your domain names. So your first domain is your main domain you signed up with and all other domains will be add-on domains. It's just the way it works.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,788
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by inline6 View Post
    Let's say ABC123.com is set as the main domain, but would it make more sense to make a subdirectory "ABC123" ( /public_html/ABC123) instead of building that site directly into /public_html? Because what if I want other different websites in the future, then they'd all be add-on domains and add-on directories
    Yes that does make sense. It can be easily done too. You just need a few lines of code in the .htaccess file to redirect all calls to the main folder onto the appropriate sub-folder so that your main domain as well as the addon domains each have their own folder.

    A quick search for easy to follow instructions brought up the following page from BlueHost - https://my.bluehost.com/cgi/help/347 (these instructions will work equally well for any hosting that uses an equivalent cPanel setup - including HostGator).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Member
    Join Date
    Dec 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all for your replies. I'm really new at this stuff and I couldn't find the answer to this confusion, but you guys have helped clarify it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •