Index: t3lib/class.t3lib_befunc.php =================================================================== --- t3lib/class.t3lib_befunc.php (revision 10022) +++ t3lib/class.t3lib_befunc.php (working copy) @@ -2695,17 +2695,18 @@ public static function getViewDomain($pageId, $rootLine = null) { $domain = rtrim(t3lib_div::getIndpEnv('TYPO3_SITE_URL'), '/'); - if (!is_array($rootLine)) { - $rootLine = self::BEgetRootLine($pageId); - } - - // checks alternate domains - if (count($rootLine) > 0) { - $urlParts = parse_url($domain); - if (self::getDomainStartPage($urlParts['host'], $urlParts['path'])) { - $protocol = t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://'; - $domain = $protocol . self::firstDomainRecord($rootLine); + if (intval($pageId) > 0) { + if (!is_array($rootLine)) { + $rootLine = self::BEgetRootLine($pageId); } + // checks alternate domains + if (count($rootLine) > 0) { + $urlParts = parse_url($domain); + if (self::getDomainStartPage($urlParts['host'], $urlParts['path'])) { + $protocol = t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://'; + $domain = $protocol . self::firstDomainRecord($rootLine); + } + } } return $domain;