HEX
Server: Apache
System: Linux 136-243-153-58.cprapid.com 4.18.0-553.81.1.el8_10.x86_64 #1 SMP Mon Oct 27 11:29:19 EDT 2025 x86_64
User: mytest (1001)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/mytest/.trash/router.php.198
<?php
/**
 * Router for PHP Built-in Server (Local Development Only)
 * This file mimics the .htaccess rewrite rules for local testing
 * In production, Apache will use .htaccess instead
 * 
 * Usage: php -S 127.0.0.1:8080 router.php
 */

$uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
$doc = __DIR__;

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

if (strpos($uri, '/admin/') === 0) {
    return false;
}

if (strpos($uri, '/assets/') === 0) {
    return false;
}

if (strpos($uri, '/api/') === 0) {
    error_log("Router: Forwarding to API - URI: $uri");
    require $doc . '/api/index.php';
    return true;
}

if ($uri === '/backoffice' || rtrim($uri, '/') === '/backoffice') {
    readfile($doc . '/admin/index.html');
    return true;
}

if ($uri === '/guest-login' || rtrim($uri, '/') === '/guest-login') {
    require $doc . '/public/pages/guest-login.php';
    return true;
}

if ($uri === '/guest-dashboard' || rtrim($uri, '/') === '/guest-dashboard') {
    require $doc . '/public/pages/guest-dashboard.php';
    return true;
}

if (strpos($uri, '/yacht-detail-friend') === 0) {
    $_GET['friend'] = '1';
    if (strpos($uri, '?') !== false) {
        parse_str(parse_url($uri, PHP_URL_QUERY), $params);
        foreach ($params as $key => $value) {
            $_GET[$key] = $value;
        }
    }
    require $doc . '/public/index.php';
    return true;
}

require $doc . '/public/index.php';
?>