<?php
// Standalone public page routes for VMO Website/index.php.
// Place after $normalized_request is calculated and before the homepage fallback.

if ($normalized_request === '/affiliate' || strpos($normalized_request, '/affiliate/') === 0) {
    $affiliate_slug = trim(substr($normalized_request, strlen('/affiliate')), '/');
    if ($affiliate_slug !== '') {
        $_GET['ref'] = rawurldecode($affiliate_slug);
    }
    require __DIR__ . '/affiliate.php';
    exit;
}

if ($normalized_request === '/affiliate-dashboard') {
    require __DIR__ . '/affiliate-dashboard.php';
    exit;
}

if ($normalized_request === '/faq') {
    require __DIR__ . '/faq.php';
    exit;
}
