public/index.php line 61

Open in your IDE?
  1. <?php
  2. use App\Kernel;
  3. use Symfony\Component\ErrorHandler\Debug;
  4. use Symfony\Component\HttpFoundation\Request;
  5. require dirname(__DIR__).'/config/bootstrap.php';
  6. #var_dump($_SERVER);exit;
  7. /*
  8. if (str_contains($_SERVER['REQUEST_URI'], 'wdt')) {exit;}
  9. if ($_SERVER['HTTP_HOST'] == 'e-roso.net'){
  10. if ((str_contains($_SERVER['REQUEST_URI'], 'admin')&& !str_contains($_SERVER['REQUEST_URI'], 'admincommunes')) || str_contains($_SERVER['REQUEST_URI'], 'avicon')) {
  11.     if ( $_SERVER['HTTP_X_FORWARDED_PROTO'] != "http"){ 
  12.     $location = 'http://www.' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
  13.     $location = str_replace("www.www","www", $location);
  14.     //header('HTTP/1.1 301 Moved Permanently');
  15.     //header('Location: ' . $location);
  16.     //exit;
  17.     //
  18.     ?>
  19. <script type="text/javascript">
  20.     window.location.href = '<?php echo $location;?>';
  21. </script>
  22. <?php
  23. exit;
  24.     } else {}
  25.     //echo 'uuuu';exit;
  26. } else {
  27. if ($_SERVER['HTTP_HOST'] != 'localhost' and $_SERVER['HTTP_X_FORWARDED_PROTO'] != "https") {
  28.     $location = 'https://www.' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
  29.     $location = str_replace("www.www","www", $location);
  30.     //header('HTTP/1.1 301 Moved Permanently');
  31.     
  32.     ?>
  33. <script type="text/javascript">
  34.         window.location.href = '<?php echo $location;?>';
  35. </script>
  36. <?php
  37. exit;
  38.     //header('Location: ' . $location);
  39.     //exit;
  40. }}
  41. }*/
  42. if ($_SERVER['APP_DEBUG']) {
  43.     umask(0000);
  44.     Debug::enable();
  45. }
  46. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? false) {
  47.     Request::setTrustedProxies(explode(','$trustedProxies), Request::HEADER_X_FORWARDED_ALL Request::HEADER_X_FORWARDED_HOST);
  48. }
  49. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? false) {
  50.     Request::setTrustedHosts([$trustedHosts]);
  51. }
  52. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  53. $request Request::createFromGlobals();
  54. $response $kernel->handle($request);
  55. $response->send();
  56. $kernel->terminate($request$response);