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.

Subdomain redirecting to another domain on my server

Discussion in 'Bind / DNS / Nameserver Issues' started by David DiGiovanni, Jan 31, 2017.

Tags:
  1. David DiGiovanni

    David DiGiovanni Registered

    Joined:
    Jan 31, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    I'm trying to create a subdomain that maps back to my root domain to serve static files. I want static.domainA.com to point to domainA.com.

    In cPanel, I setup static.domainA.com and pointed it to the /public_html folder. Then I changed the Alias of static.domainA.com to www[dot]domainA.com.

    When I visit static.domainA.com, it redirects to store.domainB.com (domainB.com is another account I have setup on my server). So basically static.domainA.com is working perfectly, except it is aliasing the wrong domain (store.domainB.com instead of domainA.com).

    Any ideas on what is going on here? Thank you!

    Server Details:

    /etc/redhat-release:CentOS release 6.8 (Final)
    /usr/local/cpanel/version:11.60.0.35
    /var/cpanel/envtype:kvm
    CPANEL=release
    Server version: Apache/2.4.16 (Unix)
    Server built: Dec 9 2015 19:19:34
    Cpanel::Easy::Apache v3.32.6 rev9999
    PHP 5.6.16 (cli) (built: Dec 9 2015 19:29:45)
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you verify how you changed the alias for this subdomain?

    Thank you.
     
    David DiGiovanni likes this.
  3. David DiGiovanni

    David DiGiovanni Registered

    Joined:
    Jan 31, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Thanks for the reply Michael.

    After I created the subdomain through cPanel, I went to the Advanced DNS page and saw an A Record listing for static.domainA.com with the alias being my server's IP address. I changed this to a CNAME Record and changed the alias to www.domainA.com.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    You actually don't need to make the change in the DNS zone after creating the subdomain. As long as you have configured the document root to the correct location, both the subdomain and it's www prefix should load the contents from the primary domain name's document root.

    Thank you.
     
Loading...

Share This Page