Certificate error when redirecting from www to non-www

Thats because Sub-Subdomains arn’t covered. please read:

all the details are in that post

a .htaccess rule like below can automatically redirect to without the www.

RewriteEngine On

# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Remove www.
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
7 Likes