<?php
$filename = 'blocked_ips.txt';

// Ensure the file exists, if not create it
if (!file_exists($filename)) {
    file_put_contents($filename, '');
}

$blockedIps = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$userIp = $_SERVER['REMOTE_ADDR'];

if (in_array($userIp, $blockedIps)) {
    header('Location: https://google.com/404');
    exit;
}
