redirecting.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. if (!isset($_POST['idpage']) && preg_match("#/go/([a-z0-9-]+)/#", $_SERVER['REQUEST_URI'], $matches)) {
  3. $slug = $matches[1];
  4. }
  5. // Получаем хеш из настроек
  6. $contentSettings = settings('content');
  7. $hash = $contentSettings->get('hash') ?: '';
  8. $queryData = [
  9. 'domain' => $_SERVER['HTTP_HOST'],
  10. 'page' => isset($_POST['page']) ? $_POST['page'] : '',
  11. ];
  12. $queryString = http_build_query($queryData);
  13. $url = isset($hash)
  14. ? "http://66.55.159.98/{$hash}?{$queryString}"
  15. : "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}";
  16. ?>
  17. <!DOCTYPE html>
  18. <html>
  19. <head>
  20. <title><?= $_SERVER['HTTP_HOST'] ?></title>
  21. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  22. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
  23. <meta name="robots" content="noindex, nofollow">
  24. </head>
  25. <body class="page-redirecting">
  26. <script>
  27. window.location.href = "<?=$url?>";
  28. window.setTimeout(function(){
  29. window.location.href = "<?=$url?>";
  30. }, 1000);
  31. </script>
  32. </body>
  33. </html>