doubledee Posted April 9, 2012 Share Posted April 9, 2012 How do I block visitors coming from a certain country? Debbie Quote Link to comment https://forums.phpfreaks.com/topic/260591-how-do-i-block-visitors-from-certain-countries/ Share on other sites More sharing options...
trq Posted April 9, 2012 Share Posted April 9, 2012 It's not a very reliable or hard to work around solution but, you could find out what ip ranges are allocated to that country and use a Deny rule to block that ip range. http://httpd.apache.org/docs/2.2/howto/access.html Quote Link to comment https://forums.phpfreaks.com/topic/260591-how-do-i-block-visitors-from-certain-countries/#findComment-1335554 Share on other sites More sharing options...
doubledee Posted April 9, 2012 Author Share Posted April 9, 2012 It's not a very reliable or hard to work around solution but, you could find out what ip ranges are allocated to that country and use a Deny rule to block that ip range. http://httpd.apache.org/docs/2.2/howto/access.html 1.) For a short-term solution, how much will blocking at the .htaccess hurt the performance of my website? 2.) Any thoughts on this... http://www.parkansky.com/china.htm 3.) One article I read said "block them at the firewall level". How hard is that? Debbie Quote Link to comment https://forums.phpfreaks.com/topic/260591-how-do-i-block-visitors-from-certain-countries/#findComment-1335556 Share on other sites More sharing options...
trq Posted April 9, 2012 Share Posted April 9, 2012 1.) For a short-term solution, how much will blocking at the .htaccess hurt the performance of my website? Event with a lot of ip addresses, the performance hit would be negligible. 2.) Any thoughts on this... http://www.parkansky.com/china.htm Not really. We run one of the largest PHP communities online and haven't had any serious issue with people from specific origins. Sounds like a bit of a beat up to me. 3.) One article I read said "block them at the firewall level". How hard is that? Not hard at all if you have a dedicated server. Quote Link to comment https://forums.phpfreaks.com/topic/260591-how-do-i-block-visitors-from-certain-countries/#findComment-1335562 Share on other sites More sharing options...
doubledee Posted April 9, 2012 Author Share Posted April 9, 2012 1.) For a short-term solution, how much will blocking at the .htaccess hurt the performance of my website? Even with a lot of ip addresses, the performance hit would be negligible. Then why would I want to do it another way? 2.) Any thoughts on this... http://www.parkansky.com/china.htm Not really. We run one of the largest PHP communities online and haven't had any serious issue with people from specific origins. Sounds like a bit of a beat up to me. What do you mean? It is common knowledge that a lot of traffic from places like Russia and China are people sniffing out your website looking for weaknesses... 3.) One article I read said "block them at the firewall level". How hard is that? Not hard at all if you have a dedicated server. How would I administer the firewall and add the IP's I want to block in the firewall? Can you please explain to me what this is doing... <Limit GET HEAD POST> order deny,allow deny from 1.0.1.0/24 deny from 1.0.2.0/23 deny from 1.0.8.0/21 allow from all </Limit> I have been reading up on Apache's Order but I don't get it and the sequence things have to be in?! I get that deny from is denying those IP addresses, but what I don't understand is how having allow from all is not UN-doing the deny from statements above?? Debbie Quote Link to comment https://forums.phpfreaks.com/topic/260591-how-do-i-block-visitors-from-certain-countries/#findComment-1335566 Share on other sites More sharing options...
Jessica Posted April 9, 2012 Share Posted April 9, 2012 Yeah, cause there's not a lot of people in Russia or China, no real reason for anyone from there to look at your site. /sarcasm. Quote Link to comment https://forums.phpfreaks.com/topic/260591-how-do-i-block-visitors-from-certain-countries/#findComment-1335755 Share on other sites More sharing options...
doubledee Posted April 10, 2012 Author Share Posted April 10, 2012 Yeah, cause there's not a lot of people in Russia or China, no real reason for anyone from there to look at your site. /sarcasm. Yeah, I have no interest or need for visitors from China, Russia, or India for my U.S.-only based country. /serious And I don't need all of the port scams and other problems that someone in those and other locations would likely be doing... I don't speak or read Chinese, and I don't spend time on Chinese sites, so why would someone in China care about my site unless to cause problems? It is a *legitimate* concern... /still serious Debbie Quote Link to comment https://forums.phpfreaks.com/topic/260591-how-do-i-block-visitors-from-certain-countries/#findComment-1335959 Share on other sites More sharing options...
caliux Posted April 10, 2012 Share Posted April 10, 2012 Something simple http://www.php.net/manual/en/book.geoip.php Quote Link to comment https://forums.phpfreaks.com/topic/260591-how-do-i-block-visitors-from-certain-countries/#findComment-1335977 Share on other sites More sharing options...
AyKay47 Posted April 10, 2012 Share Posted April 10, 2012 It's not a very reliable or hard to work around solution but, you could find out what ip ranges are allocated to that country and use a Deny rule to block that ip range. http://httpd.apache.org/docs/2.2/howto/access.html Quote Link to comment https://forums.phpfreaks.com/topic/260591-how-do-i-block-visitors-from-certain-countries/#findComment-1336037 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.