Ultimate Host Posted March 4, 2022 Share Posted March 4, 2022 Hello, with the recent news I was thinking - how I can limit access users from Russia, Crimea and Belarus without Cloudflare? Quote Link to comment Share on other sites More sharing options...
Dimitris Posted March 4, 2022 Share Posted March 4, 2022 Hello! You could code your own so you can block access from specific countries by ip. I'm not sure if there's such thing that is ready and you could use but you can definitely try and search about it. Quote Link to comment Share on other sites More sharing options...
MeTooIDK Posted March 5, 2022 Share Posted March 5, 2022 (edited) 10 hours ago, Ultimate Host said: Hello, with the recent news I was thinking - how I can limit access users from Russia, Crimea and Belarus without Cloudflare? oops Edited March 5, 2022 by MeTooIDK Quote Link to comment Share on other sites More sharing options...
MeTooIDK Posted March 5, 2022 Share Posted March 5, 2022 (edited) 10 hours ago, Ultimate Host said: Hello, with the recent news I was thinking - how I can limit access users from Russia, Crimea and Belarus without Cloudflare? ok. <? function ipddr() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) { return $_SERVER['HTTP_CLIENT_IP']; } else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { return $_SERVER['HTTP_X_FORWARDED_FOR']; } else { return $_SERVER['REMOTE_ADDR']; } } $ip = ipddr(); $ipinfo = @json_decode(file_get_contents( "https://www.geoplugin.net/json.gp?ip=" . $ip)); $cc = $ipinfo->geoplugin_countryCode; if($cc == "TW") { // Replace TW to Country You Want To Block (Country Code) echo "aaa"; } Edited March 5, 2022 by MeTooIDK Quote Link to comment Share on other sites More sharing options...
MeTooIDK Posted March 5, 2022 Share Posted March 5, 2022 1 hour ago, BastelPichi2 said: You can just ban all people from ip ranges with these countries. Just one line htaccess... WHATTT!!!!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.