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.

Parking a Subdomain on the Main Domain

Discussion in 'General Discussion' started by benfaust, Sep 7, 2006.

  1. benfaust

    benfaust Member

    Joined:
    Aug 28, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    We're trying to park a subdomain on the main domain, i.e., 'subdomain.eem.tv' => 'eem.tv'.

    We can do this though WHM, but need to be able to do this through cPanel so it can be automated by a PHP script.

    Currently, parking 'subdomain.eem.tv' on 'eem.tv' returns the error 'invalid domain subdomain'. Parking 'subdomain.www.eem.tv' results in a parked domain called 'subdomain.www'. However, parking 'subdomain.anythingelse.com' works.

    Apparently cPanel removes the master domain from any parking request, so when we try to park 'subdomain.eem.tv', it strips out 'eem.tv' and tries to park the domain 'subdomain' which isn't valid.

    Anyone know how to get around this?
     
  2. benfaust

    benfaust Member

    Joined:
    Aug 28, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    A Solution

    We came up with a working solution for this.

    By the way, we're using the class presented in this thread:
    http://forums.cpanel.net/showthread.php?t=31121

    If your configuration allows this, here's how to park a subdomain on the master domain (i.e. something.somedomain.com => somedomain.com, useful for sites which display master content but different templates/settings for different subdomains):

    1. Create or change the master domain to a fake domain name (i.e. something.com would be somethingmasterdomain.com)

    2. Park the real domain on the fake domain (i.e. something.com parked on somethingmasterdomain.com)

    That's it. Now you can park something.somedomain.com on subdomain.com using the cpanel class presented in the above link.
     
  3. moogle

    moogle Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    What are the benefits you're getting from parking a subdomain on the domain?
    Is it something that simply forwarding would not resolve for you? You can do this instantly with 1 line of php code..
     
  4. benfaust

    benfaust Member

    Joined:
    Aug 28, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    If the subdomain is not parked, it cannot get to any PHP code.
     
  5. moogle

    moogle Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    I see, so you want the subdomain to work as the domain, rather than just point to it?
     
  6. benfaust

    benfaust Member

    Joined:
    Aug 28, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    That's correct. We're running a templated system. onesub.domain.com will show the master content in one template with certain settings while anothersub.domain.com will show the same content in another template with other settings.
     
  7. moogle

    moogle Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for satifying my curiosity.
     
Loading...

Share This Page