From 0bf93f7509c3795fe8458dc2b6643a69800b0997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Wed, 20 May 2020 13:06:40 +0200 Subject: [PATCH] MAPG-7 redirect / to /game --- public/index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/index.php b/public/index.php index 6f246a3..ee4c162 100644 --- a/public/index.php +++ b/public/index.php @@ -3,6 +3,7 @@ require '../main.php'; // very basic routing +$host = $_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER["SERVER_NAME"]; $url = $_SERVER['REQUEST_URI']; switch($url) { case '/game': @@ -11,6 +12,9 @@ switch($url) { case '/getNewPosition.json': $controller = new MapGuesser\Controller\GetNewPosition(); break; + case '/': + header('Location: ' . $host . '/game', true, 302); + die; default: echo 'Error 404'; die;