alias www

Hi, I have a problem:
In our organization we bought WiledCard Certificate - *. company.org

Third-level domains are working properly, for example: mail.company.org or video.company.org etc

But as soon as I want to add an alias in the form of www.mail.company.org or www.video.company.org browsers say that the certificate is not valid.

[i]www.video.company.org uses an invalid security certificate.

The certificate is only valid for the following names:
*.company.org, company.org

(Error code: ssl_error_bad_cert_domain)[/i]

FreeBSD
Apache 2.2

Thank you in advance for your help

I do it in

[i]httpd.conf

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R,L]

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R,L]

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L][/i]

And what about this domain - *.department.company.org
I have to buy a certificate? or I can create a certificate in the admin panel in Comodo site?

PS. I already have WiledCertificate *.company.org

Hi,

The certificate for *.company.org will only work on a domain where the * is replaced with a name.

Putting www infront of that name makes it a second level ie ..company.org which is why
the certificate errors appear.
Certificates for ..company.org are not available, to the best of my knowledge.

A wildcard will only work on one level *.company.org

I am not sure how you will get around this in your examples.

Regards
Garry