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!

Show a 404 not found on 2nd level domain with a wildcard ssl

Discussion in 'General Discussion' started by Daniel D., Jan 27, 2016.

  1. Daniel D.

    Daniel D. Registered

    Joined:
    Jan 27, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Germany
    cPanel Access Level:
    Website Owner
    Hey guys!
    Over the last couple of days I've been really frustrated with my hosting company as they can't find a solution on this issue and I thought that maybe here someone will know what to do.

    The Problem:
    Last year I've purchased a wildcard ssl certificate which was installed on my domain (I'm on a shared plan).
    example.com
    blabla.example.com
    muhahah.example.com

    they all have a valid certificate now. Just as expected.

    Now the unexpected part - I found my website listed in google with https://blabla.blabla.example.com

    I've never configured such a domain and I was shocked to find it in google's index. My hosting company explained to me that this is the way cpanel is configured and when you enter a first level subdomain like blabla.example.com -> it looks for the blabla folder in public_html. If it doesn't exist it will trigger a 404 not found (which I expect and understand). But if you enter blabla.blabla.example.com instead of looking for a blabla folder the server loads the content of the public_html???

    Okay, so how do I do a redirect here? I was able to redirect http://blabla.blabla.example.com to Example Domain, but I'm unable to redirect https://blabla.blabla.example.com to Example Domain. When the user visits https://blabla.bla.example.com - instead of the expected redirect the user gets a certificate error. He first needs to accept the certificate in order for the redirect to work. Is there actually any way for me to actually do a redirect or at least to trigger a 404 message on this subdomain?

    I want to get https://blabla.blabla.example.com out of the google index and for this I need to either do a 301 redirect to our main site or to show a 404 message. I have no clue why this subdomain got listed in the first place and I don't understand why google is indexing it when it has an invalid certificate...
     
    #1 Daniel D., Jan 27, 2016
    Last edited by a moderator: Jan 27, 2016
  2. Daniel D.

    Daniel D. Registered

    Joined:
    Jan 27, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Germany
    cPanel Access Level:
    Website Owner
    Since I'm not able to edit my post, I'll need to post again here. What I wanted to write above is that I actually understand that I can't do a 301 redirect over https if I don't have a valid certificate. The browser first needs to establish the secure connection and after that the redirect can happen. But since that subdomain doesn't have a valid certificate it won't work.
    So basically my questions is - is there a way to show that subdomain as non-existing?
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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