php path _SERVER REQUEST_URI if _SERVER HTTP_HOST en petroffpalacehote

1
2
3
4
5
6
7
8
9
<?php
$path = $_SERVER['REQUEST_URI'];
if ($_SERVER['HTTP_HOST'] == "en.petroffpalacehotel.ru")
$targetLang = 'ru';
else
$targetLang = 'en';
?>
<link rel="alternate" hreflang="<?= $targetLang ?>" a href="https://<?= $targetLang ?>.petroffpalacehotel.ru<?= $path; ?>"