Hello, I’m creating a wordpress multisite with subdomains and a letsencrypt wildcard ssl cert, everything is working fine except for this…
I’m having problems with htaccess redirection.
I’m using this code
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.)$ [NC]
RewriteRule ^(.)$ https://%1/$1 [R=301,L]
in htaccess to redirect http://, http://www. and www. to https://non www and it is working fine. For example it will redirect http://subdomain.mainsite.com to https://subdomain.mainsite.com and www.subdomain.mainsite.com to https://subdomain.mainsite.com.
But if i try to open https://www.subdomain.mainsite.com it will not redirect to https://non www creating an ssl cert error.
What I’m doing wrong?