MAPG-7 redirect / to /game

This commit is contained in:
Bence Pőcze 2020-05-20 13:06:40 +02:00
parent 2c9a3ec23c
commit 0bf93f7509

View File

@ -3,6 +3,7 @@
require '../main.php'; require '../main.php';
// very basic routing // very basic routing
$host = $_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER["SERVER_NAME"];
$url = $_SERVER['REQUEST_URI']; $url = $_SERVER['REQUEST_URI'];
switch($url) { switch($url) {
case '/game': case '/game':
@ -11,6 +12,9 @@ switch($url) {
case '/getNewPosition.json': case '/getNewPosition.json':
$controller = new MapGuesser\Controller\GetNewPosition(); $controller = new MapGuesser\Controller\GetNewPosition();
break; break;
case '/':
header('Location: ' . $host . '/game', true, 302);
die;
default: default:
echo 'Error 404'; echo 'Error 404';
die; die;