Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Pointing a subdomain to same dir as the domain

Discussion in 'General Discussion' started by Yobby, Feb 20, 2006.

  1. Yobby

    Yobby Registered

    Joined:
    Feb 20, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    151
    I am an end user and I have a domain (domain.com) located at /public_html/
    Currently when adding a subdomain (sub.domain.com), it gets its own directory (/public_html/sub/).
    But I want sub.domain.com to point to the files in /public_html/ (thus having the same root).
    And not using a redirect, because I want a script in /public_html/index.php to see how the visitor go there.

    How can I get that to work? Either by using htaccess files or asking my hosting-provider to edit something.

    (btw, my hosting-provider directed me to this forum)
     
  2. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    920
    Likes Received:
    13
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    Go to your cpanel control centre and delete the sub domain, then make the old sub domain a "parked domain". That way it will point to your main domain name.
    Your hosting provider should have told you this.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    Ask your host to change the DocumentRoot of your subdomain from /home/<user>/public_html/<subdomain> to /home/<usre>/public_html/ in httpd.conf

    That should work...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice