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.

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:
    1
    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:
    865
    Likes Received:
    9
    Trophy Points:
    18
    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.
     
  3. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    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...
     
Loading...

Share This Page