The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Addon Domain Problem

Discussion in 'General Discussion' started by udinnet, Jan 15, 2011.

  1. udinnet

    udinnet Member

    Joined:
    Oct 18, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Hi there,
    I'm using cpanel. Few days ago I got a new domain and I added it as a add-on domain to my cpanel. The cpanel was configured to my main domain(ex:- www.maindomain.com) and not for the new domain(ex:- newdomain.com). So I saw a folder was created for the new domain in public_html/ folder.

    Now my question is, yesterday I saw my new site was in google... But it shows the url as http://www.maindomain.com/newdomain.com ????

    Actually what was this? Will it keep always like that? What is the possible solution to set the domain as

    http://www.newdomain.com

    Thanks.:)
     
  2. usman43

    usman43 Member

    Joined:
    May 16, 2008
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    While making a domain addon , entering domain name (lets say newdomain.com) in the filed 'New Domain Name:' at cPanel > Domains > Addon Domains , cPanel automatically fills the 'Document Root:' as public_html/newdomain.com , which means that newdomain.com's web content will load from /home/USER/public_html/newdomain.com folder.
    Note that by default web content for main domain (say maindomain.com) loads from public_html and you can load any page or sub directory under it as

    http://www.maindomain.com/file_name
    or
    http://www.maindomain.com/folder_name

    here since 'newdomain.com' is a sub directory under public_html , URL: http://www.maindomain.com/newdomain.com will load web content in /home/USER/public_html/newdomain.com that is what you see at google.

    To avoid this , make sure you manually fill in 'Document Root:' while creating addon domain and remove the '.com' part from the new domain name. A better choice would be to fill 'Document Root:' as 'newdomain' instead of 'public_html/newdomain.com' which will make the sub directory outside of public_html for new addon domain.
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    This will only work if WHM > Tweak Settings > public_html subdomains only is set to Off by the host. If it is set to On, then subdomains (and addon domains) can only be created in public_html folder.
     
Loading...

Share This Page