<?php
// EasyStream Custom Page Router
define('_ISVALID', true);

$request_uri = $_SERVER['REQUEST_URI'];
$path = parse_url($request_uri, PHP_URL_PATH);
$path = trim($path, '/');

// Handle custom pages
switch ($path) {
    case 'signin':
        if (file_exists('signin.php')) {
            include 'signin.php';
            exit;
        }
        break;
    case 'register':
        if (file_exists('register.php')) {
            include 'register.php';
            exit;
        }
        break;
    case 'browse':
        if (file_exists('browse.php')) {
            include 'browse.php';
            exit;
        }
        break;
    case 'upload':
        if (file_exists('upload.php')) {
            include 'upload.php';
            exit;
        }
        break;
    case 'logout':
        if (file_exists('logout.php')) {
            include 'logout.php';
            exit;
        }
        break;
    default:
        // Fall back to main index
        include 'index.php';
        break;
}
?>