Hello all,
I need an advice:
I have 2 domain names and I need to point all of this including (www) to one virtual host
i.e.
http:example1.com -> https://example.com
https:/example1.com -> https://example.com
http://www.example.com ->https://example.com
https://www.example1.com -> https://example.com
I have generated a letsecrypt wildcard certificate for second domain example1.com-0001 and created a second virtual hosts with the same host/doc root
my .htaccess in a mutual doc root:
RewriteEngine on
RewriteCond http://example1\.com$ [OR]
RewriteCond https://www\.example1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com\.ua$ [NC]
RewriteRule ^(.*)$ https://example.com./$1 [R=301,L]
If I curl to http://example1.com or http://www.example1.com it redirects to https://example.com
but for https://example1.com or https://www.example1.com it responces:
curl -I https://example1.com
curl: (60) SSL: no alternative certificate subject name matches target host name 'example1.com'
curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it.
Please help.
I need an advice:
I have 2 domain names and I need to point all of this including (www) to one virtual host
i.e.
http:example1.com -> https://example.com
https:/example1.com -> https://example.com
http://www.example.com ->https://example.com
https://www.example1.com -> https://example.com
I have generated a letsecrypt wildcard certificate for second domain example1.com-0001 and created a second virtual hosts with the same host/doc root
my .htaccess in a mutual doc root:
RewriteEngine on
RewriteCond http://example1\.com$ [OR]
RewriteCond https://www\.example1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com\.ua$ [NC]
RewriteRule ^(.*)$ https://example.com./$1 [R=301,L]
If I curl to http://example1.com or http://www.example1.com it redirects to https://example.com
but for https://example1.com or https://www.example1.com it responces:
curl -I https://example1.com
curl: (60) SSL: no alternative certificate subject name matches target host name 'example1.com'
curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it.
Please help.