0

If I have undefined subdomains, and there is a wildcard subdomain defined for the domain (via the hosting account at JustHost), is it possible to have a wildcard SSL certificate for subdomains that have not yet been defined?

For instance, a URL of https://fred.example.com needs to have a valid certificate. A wildcard subdomain has been set up for *.example.com . The fred.example.com subdomain has not been explicitly defined.

Any access to https://fred.example.com will be redirected by an htaccess rule to a specific page ('landing.php'), which will process the 'fred' part of the URL:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ https://www.example.com/landing.php?q=$1 [R=302,L]

Note that the subdomain can be any value. The landing.php file takes care of processing valid subdomain name values.

The current configuration at my host (JustHost) results in an "SSL_ERROR_BAD_CERT_DOMAIN" on the browser. I need https://fred.example.com to be valid, so that the htaccess rule can redirect it.

Lex Li
  • 1,235
  • 8
  • 10
  • "The fred.example.com subdomain has not been explicitly defined." -- there needs to be a DNS record for this part, though wildcard DNS is also a thing. – thrig Aug 13 '22 at 01:59
  • 1
    You need to consult JustHost with this use case. They have their own setup for hosting, and most of us don't know how it works internally. Therefore we cannot tell how to make this wildcard cert domain the default virtual host, which would solve the problem. – Tero Kilkanen Aug 13 '22 at 07:37
  • "a wildcard SSL certificate" is certainly a thing, but unless this is your own server then you'll need to contact your host ("JustHost"). – MrWhite Aug 13 '22 at 22:33

0 Answers0