Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Below is a snippet from my httpd.conf file. The problem I'm having is that when I access "https://www.subdomain2.domain.co.uk" I get a "certificate error" indicator in the URL bar in IE7:

"The security certificate presented by this website was issued for a different 
website's address"

The strange thing is "https://www.domain.co.uk" and "https://subdomain1.domain.co.uk" work fine.

<VirtualHost _default_:443>
ServerName *.domain.co.uk
RewriteEngine On

RewriteCond %{HTTP_HOST} ^www.domain.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.domain.co.uk/$1 [P]

RewriteCond %{HTTP_HOST} ^subdomain1.domain.co.uk$ [NC]
RewriteRule ^(.*)$ http://subdomain1.domain.co.uk/$1 [P]

RewriteCond %{HTTP_HOST} ^www.subdomain2.domain.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.subdomain2.domain.co.uk/$1 [P]
share|improve this question
    
@cjc below is right. Look at using a redirect from www.subdomain2.domain.co.uk to subdomain.domain.co.uk or purchase another wildcard cert. –  KM. Nov 11 '11 at 14:09
    
@KM01, the redirect won't work, since the SSL handshake (and the certificate warning) will happen before HTTP. –  cjc Nov 11 '11 at 16:59
    
You're right @cjc. I meant redirect from http://www.subdomain... to https://subdomain... –  KM. Nov 11 '11 at 21:25

2 Answers 2

up vote 3 down vote accepted

Wildcard certificates only work for one level of the name. So, if your current cert works for subdomain2.domain.co.uk, it will not work for www.subdomain2.domain.co.uk. You will need another wildcard in that case.

share|improve this answer

Yep. This is a certificate problem, nothing else. You may have a certificate that is valid only for www and subdomain1. Only. The solution is to buy a certificate with a wildcard (= more expensive). This way it will be valid for all the subdomains.

For more information about wildcard ssl certificates, see here and here.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.