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!

Wildcard SSL - Or - Appending to a file

Discussion in 'cPanel Developers' started by TimPhin, Apr 24, 2015.

  1. TimPhin

    TimPhin Member

    Joined:
    Mar 18, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AL
    cPanel Access Level:
    Root Administrator
    Using WHM API / cPanel API 2 I was able to successfully allow users to create accounts on my server which automatically created them cPanel accounts with a sub domain on the main server domain.

    Installed a wildcard SSL only to find out it won't cover these sub domains because they are not in the root domain folder.

    So now I have written so it just creates a sub domain on the main domain cPanel account so it is in that public folder (public_html/subdomain) instead of it's own cPanel account.

    BUTit looks like I will have to modify the .htaccess file just to get the sub domains covered with the SSL. Otherwise when going to httpS it shows the content of the main domain.

    So 2 questions.
    1) Is there is a way to have the SSL cover the sub domain cPanel accounts automatically?

    2) With this solution here, adding entries into the .htaccess file of the main domain for the sub domains, is there a way using Fileman fuctions to append to the .htaccess file information of the new sub domain created?

    Thanks1
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,884
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Could you elaborate on this statement? Does the SSL certificate fail to load, or produce a specific error message?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. TimPhin

    TimPhin Member

    Joined:
    Mar 18, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AL
    cPanel Access Level:
    Root Administrator
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,884
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Did you install the SSL certificate for each subdomain individually or did you only install the wildcard certificate itself?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. TimPhin

    TimPhin Member

    Joined:
    Mar 18, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AL
    cPanel Access Level:
    Root Administrator
    Hello,

    The wildcard certificate was installed itself.

    Thank you
     
  6. TimPhin

    TimPhin Member

    Joined:
    Mar 18, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AL
    cPanel Access Level:
    Root Administrator
    To follow up, the wildcard certificate was installed on the server for the main domain on the server (which also has a cPanel account).

    Since it is a wildcard SSL, is it possible to install it for each sub domain to this domain which are on their own cPanel accounts?
     
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,884
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Yes, please try installing the certificate for each individual subdomain through cPanel. Let us know if the issue continues.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. TimPhin

    TimPhin Member

    Joined:
    Mar 18, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AL
    cPanel Access Level:
    Root Administrator
    Thanks for the help. I am able to Browse Certificates -> Select Certificate -> Select the account for the main domain. Then enter in the sub domain for the domain (sub.thisdomain.com). It works (putting it up here in case it helps someone else).

    Now just to see if I can write something with the WHM API to automate it for me.

    Thanks again Michael
     
  9. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,884
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    I am happy to see the issue is now resolved. Thank you for updating us with the outcome.
     
    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