I have a site which is only for US/Canada/UK visitors. I don't want to make it visible to other visitors.
I tried to put ip ranges in .htaccess (Deny IP) but it does not work for me. May be I have inaccurate ip lists or I am doing something wrong.
|
I have a site which is only for US/Canada/UK visitors. I don't want to make it visible to other visitors. I tried to put ip ranges in .htaccess (Deny IP) but it does not work for me. May be I have inaccurate ip lists or I am doing something wrong. |
|||||||||||
|
|
Maybe you can get user's IP adress , and control it on this site via cURL and get Country information. Bu i don't know, is this best way. This method will reduce performance. |
|||
|
|
|
Blocking by IP isn't a good solution anymore. You already got some obvious problems this approach can lead into. You may end allowing undesired people, and blocking desired ones. One question: what technologies are you allowed to use? After all, you can use GEO Location features and extensions available for Java, PHP, Python, Ruby or even Javascript. |
|||
|
|
|
As has been pointed out, what you're trying to do is not going to work. And it's not a good idea either. It's not how the internet works. |
|||
|
|
|
You might end up with blocking a very long list of IPs. People here try blocking India, Philippines and Pakistan - maybe this could solve a part of your problem. |
|||
|
|
|
You can get country IP ranges from this website and add them to a .htaccess file in public_html. It doesn't take as long as you think. http://www.countryipblocks.net/country-blocks/htaccess-deny-format/ Some of the comments above are correct though. Especially about traveling visitors. It depends what your site is used for. If you're selling CPA offers then fine, but if you have a membership site of some sort, I'd think twice. Instead, look around for a script that will redirect visitors from undesirable locations. Hope this helps. |
|||
|
|
|
You are probably not getting the answer you want because most of these people are from these countries and are offended... I see a need to block these countries and a few more to fight spam and people trying to hack your root server - like China... I get about 60-100 hack attempts everyday from China so I blocked the entire country and those spammy countries to (India, Indonesia,Pakistan...) The traffic from those countries is worthless anyway. In most cases you don't generate revenue from them anyway so why supply them with info and waste resources...? Use CSF and block the entire countries. It's the easiest way and uses the least amount of resources. http://configserver.com/cp/csf.html |
|||||||
|
|
i am using this free generator.. that goes in the htaccess file.. http://www.ip2location.com/free/visitor-blocker |
|||
|
|
|
FYI : I got 1600 false registrations in approximatly a week to the Joomla! panel on my website. I get frequent spam registrations to the forum on my website with posts like : get great deals on ... @!k* enlargement ... And other advertisement from different languages. I doubt that IP blocking is a good idea because of IP spoofing. |
|||
|
|