// Array of disallowed country codes $blockedCountries = ['CN']; // Get the current server API $api = php_sapi_name(); // Bypass geo checks for non-web server APIs (CLI, cron, etc.) if ($api === 'cli') { return; } // Retrieve the country code or default $countryCode = $_SERVER['GEOIP_COUNTRY_CODE'] ?? 'Unknown'; // Block access if the country code is in the blocked list if (in_array($countryCode, $blockedCountries)) { header('HTTP/1.1 404 Not Found', true, 404); exit; } // End of Geographic Access Restriction code Media - Earthdance International

This content is password-protected. To view it, please enter the password below.

Translate »