<?php
/**
 * URL Debug Page
 */

echo "<h2>URL Debug Information</h2>";

echo "<p><strong>Current Script:</strong> " . $_SERVER['SCRIPT_NAME'] . "</p>";
echo "<p><strong>Request URI:</strong> " . $_SERVER['REQUEST_URI'] . "</p>";
echo "<p><strong>HTTP Host:</strong> " . $_SERVER['HTTP_HOST'] . "</p>";
echo "<p><strong>Server Name:</strong> " . $_SERVER['SERVER_NAME'] . "</p>";
echo "<p><strong>Document Root:</strong> " . $_SERVER['DOCUMENT_ROOT'] . "</p>";

echo "<h3>Testing Redirects:</h3>";
echo "<p><a href='parent_portal/index.php'>Test relative link to parent portal</a></p>";
echo "<p><a href='/bidda/parent_portal/index.php'>Test absolute link to parent portal</a></p>";

echo "<h3>Directory Check:</h3>";
if (is_dir('parent_portal')) {
    echo "<p style='color: green;'>✅ parent_portal directory exists</p>";
    if (file_exists('parent_portal/index.php')) {
        echo "<p style='color: green;'>✅ parent_portal/index.php file exists</p>";
    } else {
        echo "<p style='color: red;'>❌ parent_portal/index.php file does NOT exist</p>";
    }
} else {
    echo "<p style='color: red;'>❌ parent_portal directory does NOT exist</p>";
}

echo "<h3>Current Working Directory:</h3>";
echo "<p>" . getcwd() . "</p>";
?>