21 $this->url = $this->getCurrentUrl();
27 public function setUrl(
string $url): void
43 private function getCurrentUrl(): string
49 if (class_exists(
'\LandingPubComponent'))
51 $landingInstance = \LandingPubComponent::getMainInstance();
54 $context = Main\Context::getCurrent();
56 $realFilePath =
$context->getServer()->get(
'REAL_FILE_PATH');
59 $realFilePath =
$_SERVER[
'REAL_FILE_PATH'] ??
null;
63 $realFilePath =
$context->getServer()->get(
'SCRIPT_NAME');
66 $realFilePath = str_replace(
'/index.php',
'/', $realFilePath);
69 $landingUrl = \Bitrix\Landing\Site::getPublicUrl($landingInstance[
'SITE_ID']);
70 if (mb_strpos($landingUrl, $realFilePath) ===
false)
75 $uri =
new Main\Web\Uri($landingUrl);
90 return (
$request->isHttps() ?
"https://" :
"http://").$host.$requestUri;
if(file_exists($_SERVER['DOCUMENT_ROOT'] . "/urlrewrite.php")) $uri