Forum Moderators: phranque
I've sucessfully installed a wildcard certificate on a plesk (v8) server that runs apache Apache/2.2.3.
I've also set it up so that I can use wildcard subdomains that are all handled in one place. eg:
http://one.domain.com
http://two.domain.com
http://three.domain.com
https://one.domain.com
https://two.domain.com
https://three.domain.com
In Plesk you go into the DNS section of your domain,
add an A record that makes *.domain.com point to your domain's dedicated IP.
Then create a vhost.conf and vhost_ssl.conf in the conf folder:
/var/www/vhosts/domain.com/conf/
each of which contain:
ServerAlias *.domain.com
Then issue these two commands:
/usr/local/psa/admin/bin/websrvmng -a -v
service httpd restart
I've also added a .htaccess to redirect
[domain.com...] to [one.domain.com...] as follows:
RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) https://www.domain.com%{REQUEST_URI} [R]
All this works just fine.
The problem is that the https redirect from
[domain.com...] to [one.domain.com...]
does not work. When you try to open [domain.com...] it states that the certificate *.domain.com is not valid for domain.com
Does anybody know how to get this last piece of the puzzle to work?
Many thanks!
Sean
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
It will redirect:
[one.domain.com...]
[two.domain.com...]
[three.domain.com...]
[one.domain.com...]
[two.domain.com...]
[three.domain.com...]
[domain.com...]
but [domain.com...] is still not redirecting and is showing the invalid certificate message..
Any ideas?