diff options
author | MaZderMind | 2014-11-29 19:31:21 +0100 |
---|---|---|
committer | MaZderMind | 2014-11-29 19:31:21 +0100 |
commit | 6fea306ab914287bc2e6ec242f440e31e440110f (patch) | |
tree | 21c308f2fc31999ff9c8a31491c5ecddd9b8bf0b /index.php | |
parent | a3f189df339781c6aa4177b03cc1175a6bc53efe (diff) |
move url rewriting into php
for better compatibility with nginx
Diffstat (limited to '')
-rw-r--r-- | index.php | 77 |
1 files changed, 71 insertions, 6 deletions
@@ -1,10 +1,75 @@ <?php -require_once('lib/bootstrap.php'); +$route = @$_GET['route']; +$route = rtrim($route, '/'); -echo $tpl->render(array( - 'page' => 'rooms', - 'title' => 'Overview', - 'rooms' => $GLOBALS['CONFIG']['ROOMS'], -)); + +if($route == '') +{ + include('pages/rooms.php'); +} + +else if(preg_match('@^(saal1|saal2|saalg|saal6|sendezentrum)$@', $route, $m)) +{ + $_GET = array( + 'room' => $m[1], + 'format' => 'sd', + 'language' => 'native', + ); + include('pages/room.php'); +} + +else if(preg_match('@^(saal1|saal2|saalg|saal6)/translated$@', $route, $m)) +{ + $_GET = array( + 'room' => $m[1], + 'format' => 'sd', + 'language' => 'translated', + ); + include('pages/room.php'); +} + +else if(preg_match('@^(saal1|saal2|saalg|saal6|sendezentrum)/(hd|audio|slides)$@', $route, $m)) +{ + $_GET = array( + 'room' => $m[1], + 'format' => $m[2], + 'language' => 'native', + ); + include('pages/room.php'); +} + +else if(preg_match('@^(saal1|saal2|saalg|saal6)/(hd|audio|slides)/translated$@', $route, $m)) +{ + $_GET = array( + 'room' => $m[1], + 'format' => $m[2], + 'language' => 'translated', + ); + include('pages/room.php'); +} + +else if(preg_match('@^(lounge|ambient)$@', $route, $m)) +{ + $_GET = array( + 'room' => $m[1], + 'format' => 'audio', + ); + include('pages/party.php'); +} + +else if(preg_match('@^about$@', $route, $m)) +{ + include('pages/about.php'); +} + +else if(preg_match('@^program.json$@', $route, $m)) +{ + include('pages/program-json.php'); +} + +else +{ + include('pages/404.php'); +} |