<?php
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$uri = urldecode($uri);

$requested = __DIR__ . $uri;

if ($uri === '/logout') {
    require_once 'logout.php';
    exit;
}

if ($uri === '/login') {
    require_once 'login.php';
    exit;
}

if ($uri !== '/' && file_exists($requested)) {
    return false;
}

require_once 'index.php';
?>
