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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Subdomain redirecting incorrectly

Discussion in 'Bind / DNS / Nameserver Issues' started by Thorsten H., Nov 2, 2016.

Tags:
  1. Thorsten H.

    Thorsten H. Active Member

    Joined:
    Jul 13, 2016
    Messages:
    40
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Germany
    cPanel Access Level:
    Root Administrator
    Hello,
    I got a new server and put one of my larger domains on it. the domain also has a subdomain.

    here is my problem:
    when I call Website1 everything is fine and the shop starts.
    when I call Website1-Subdomain I'm redirected to new-website.tld and I don't know why.

    The DNS-Entries are nearly 10 hours old (website1.tld). The cPanel included DNS is disabled, I use the one of my registrar.

    By now I don't know what to do; is it just because the DNS-Change is to new or is there an error in the configuration?

    And no, I have checked both clients (website1.tld and new-website.tld), there are no redirects!

    Regards
    Thorsten
     
    #1 Thorsten H., Nov 2, 2016
    Last edited by a moderator: Nov 2, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You will need to ensure the "A" record for the subdomain is manually configured at your domain registrar pointing to the account's IP address. Or, simply configure your own custom name servers to avoid this requirement:

    [Tutorial] Nameserver configuration on cPanel servers

    Thank you.
     
  3. Thorsten H.

    Thorsten H. Active Member

    Joined:
    Jul 13, 2016
    Messages:
    40
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Germany
    cPanel Access Level:
    Root Administrator
    I think, that is the wrong direction, the subdomain (shop.domain.tld) is working but when I call www.domain.tld I will be redirected to Default Web Site Page. If I call the domain with HTTPS I get an SSL-error and then I will be redirected to diff-domain.tld. I don't understand that. I have edited the DNS-entry and added shop. to the IP evan that *. is present.
     
    #3 Thorsten H., Nov 2, 2016
    Last edited by a moderator: Nov 2, 2016
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Do you have "www.domain.tld" configured with an "A" record at your registrar pointing to the correct IP address? Regarding the issue with SSL, it's likely because that domain shares the same IP address with the other domain name on the same server. Thus, since no SSL certificate is installed on this domain, it automatically uses the first VirtualHost with a SSL certificate on the IP. Here's a document that explains how this happens:

    SSL FAQ and Troubleshooting - Documentation - cPanel Documentation.

    Thank you.
     
  5. Thorsten H.

    Thorsten H. Active Member

    Joined:
    Jul 13, 2016
    Messages:
    40
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Germany
    cPanel Access Level:
    Root Administrator
    OK, by now I understand some thinks.

    To the background: I have 2 servers, an old and a new one. I have transfered the problem-domain to the new server; prior it was on the old one. So I only had to change the IP at the DNS of my registrar.
    On the old server every thing was fine; I could call the subdomain (shop.) and the domain by itself (www.domain.tld and domain.tld).

    After transfering the complete contend to the new server I changed the IP to the new one. After ca. 2 hours I could call the subdomain at the new server. But I could call the domain.tld all day, since I changed the adress.

    The problems with the domain changed; first the domain (www.domain.tld and domain.tld) where redirected to another domain on the old server that I host.

    And NOW??? Everything is fine again; it lasts a little bit longer to change :-( - thanks to you all and good night from germany.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm happy to see the issue is now resolved. Thank you for updating this thread with the outcome.
     
Loading...

Share This Page