Redirect from www to non www with https

To Redirect from www to now www with https follow below steps

open .htacess file and add below rule

Replace domain.tld with your domain name

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.tld [NC]
RewriteRule ^(.)$ http://domain.tld/$1 [L,R=301]

RewriteCond %{HTTPS} !=on

RewriteRule ^(.)$ https://%{HTTP_HOST}/$1 [L,R=301]