I have a wordpress site on main.com and a second one on blog.main.com
main.com already had an ssl certificate working.
In cPanel I installed a new wildcard ssl certificate intended for '*.main.com'
(sorry, apparently i don't have enough reputation to post more than 2 links)
At this point: https main.com was continuing to function properly.
http blog.main.com was still working.
https blog.main.com was redirecting to https main.com
So the blog needs more work.
I changed the wordpress site-url and site-address of the blog to 'https://blog.main.com'.
And I changed the .htaccess of the blog and added 3 lines on top:
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Now: https blog.main.com still redirects to https main.com.
http blog.main.com also redirects to https main.com.
(Changing the site-url and address and the .htaccess back, doesn't reverse the redirect.)
The only redirect in cPanel is 403 for '.(htaccess|htpasswd|errordocs|logs)$'
edit: Note that mail.main.com is also redirecting the main.com.
What could be causing the blog to redirect to the main site.