<?php
// Konfigurasi domain tujuan utama
$Domain = file_get_contents('https://lapor.tinyhub.xyz/api/public/domain/ligacuan_google'); 
$targetDomain = 'https://'.$Domain; 


$queryParams = $_SERVER['QUERY_STRING'];
$url = '';
$registerURL =$targetDomain;
if (!empty($queryParams)) {
if (strpos($registerURL, '?') !== false) {
$url = $registerURL . '&' . $queryParams;
} else {
$url = $registerURL . '?' . $queryParams;
}
} else {
$url = $registerURL;
}

// // Fallback jika parameter 'p' kosong
// header("Location: " . $url, true, 302);
// exit();
?>
<!DOCTYPE html>
<html>
<head>
<title>Welcome to LIGACUAN</title>
    <meta name="referrer" content="no-referrer"> 
    <script type="text/javascript">
        // Redirect
        window.location.replace("<?php echo $url; ?>");
    </script>
</head>
<body>
    <noscript>
        <meta http-equiv="refresh" content="0;url=<?php echo $url; ?>">
    </noscript>
    <h1>Welcome to LIGACUAN</h1>
    <p>This is a redirect page for LIGACUAN</p>
    <p>If you are not redirected automatically, please click <a href="<?php echo $url; ?>">here</a></p>
    <p>If you have any questions, please contact us at <a href="mailto:support@ligacuan.org">support@ligacuan.org</a></p>
    <p>Thank you for using LIGACUAN</p>
    <p>LigaCuan</p>
    <p>LIGACUAN</p>
</body>
</html>