Index: branches/5.3.x/core/units/site_domains/site_domain_eh.php =================================================================== diff -u -N -r15902 -r15999 --- branches/5.3.x/core/units/site_domains/site_domain_eh.php (.../site_domain_eh.php) (revision 15902) +++ branches/5.3.x/core/units/site_domains/site_domain_eh.php (.../site_domain_eh.php) (revision 15999) @@ -1,6 +1,6 @@ setEventParam('raise_warnings', 0); } else { - if ( PROTOCOL == 'https://' ) { - return $this->querySiteDomain('SSLUrl', rtrim($this->Application->BaseURL(), '/')); - } + $domain_field = PROTOCOL == 'https://' ? 'SSLDomainName' : 'DomainName'; - return $this->querySiteDomain('DomainName', $_SERVER['HTTP_HOST']); + return $this->querySiteDomain($domain_field, $_SERVER['HTTP_HOST']); } } @@ -85,10 +83,8 @@ } elseif (($redirect_mode == SITE_DOMAIN_REDIRECT_CURRENT) && ($domain_by_ip != $domain_by_name)) { // redirect to a domain detected by IP (when not already on it) - if ((PROTOCOL == 'https://') && !$site_domain['SSLUrlUsesRegExp'] && $site_domain['SSLUrl']) { - // need to remove sub folder from ssl url - $ssl_url = preg_replace('/^(https:\/\/[^\/]*)(\/.*){0,1}$/', '\\1', $site_domain['SSLUrl']); - $this->Application->Redirect('external:' . $ssl_url . $_SERVER['REQUEST_URI']); + if ((PROTOCOL == 'https://') && !$site_domain['SSLDomainNameUsesRegExp'] && $site_domain['SSLDomainName']) { + $this->Application->Redirect('external:https://' . $site_domain['SSLDomainName'] . $_SERVER['REQUEST_URI']); } elseif ((PROTOCOL == 'http://') && !$site_domain['DomainNameUsesRegExp']) { $this->Application->Redirect('external:http://' . $site_domain['DomainName'] . $_SERVER['REQUEST_URI']);