https:// on www. domain not working

I have found that if I add the site to the domain mapping and force ssl, it doesn't work. However, if I change it to just, it works.

I think I have tracked down the problem to the function force_ssl_on_mapped_domain where the www is replaced ($domain = str_replace("www.", "", $domain ):wink: and then used to look up the map in the database:

SELECT scheme FROM " . DOMAINMAP_TABLE_MAP . " WHERE domain=%s", $domain

This always fails. Because of this, line 582 in Mapping.php redirects to the http version:

elseif( domain_map::utils()->force_ssl_on_mapped_domain() === 0 && is_ssl() ){ //force http
wp_redirect( $current_url);

Please advise as I don't want to hack your plugin to make this work. I could be missing something more basic.