• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/domain.php
  • Класс: BitrixLandingDomain
  • Вызов: Domain::getHostUrl
static function getHostUrl()
{
	static $hostUrl = null;

	if ($hostUrl !== null)
	{
		return $hostUrl;
	}

	$request = Context::getCurrent()->getRequest();
	$protocol = ($request->isHttps() ? 'https://' : 'http://');

	if (defined('SITE_SERVER_NAME') && SITE_SERVER_NAME)
	{
		$host = SITE_SERVER_NAME;
	}
	else
	{
		$host = Option::get('main', 'server_name', $request->getHttpHost());
	}

	$hostUrl = rtrim($protocol . $host, '/');

	return $hostUrl;
}