REQUEST_URI (original): /debug.php SCRIPT_NAME: /debug.php Script dirname: / After script name removal: /debug.php After trim: 'debug.php' Final REQUEST_URI: /debug.php Route Matching Test: Route: / => Pattern: #^/$# => Match: NO Route: /login => Pattern: #^/login$# => Match: NO Route: /register => Pattern: #^/register$# => Match: NO Route: /dashboard => Pattern: #^/dashboard$# => Match: NO