If you have a website, sometimes you would want to block visitors coming from a country. For example you are running a promotion for certain countries and you don’t want visitors from other country to see it. Other than that, many years ago when I was in the e-book selling business, there are two countries (I am not going to reveal) which has very high chargeback cases, meaning they buy with their credit card and then inform their credit card company that they did not authorize the charge. The credit card company will then reverse the charges, allowing the buyer to get the intangible product for free by cheating. No matter how much proof I provided to the company that charged the credit card, the buyer still gets the advantage of reversing the charges.
So my last resort was to block the whole country and sending them to a Forbidden page that says “You don’t have permission to access / on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request”. It did reduced the amount of chargebacks significantly and I didn’t notice any drops on the sales because the legitimate buyers comes from other countries.
To block a country using .htaccess, you must first need to know the IP address range but Block A Country and Country IP Blocks simplifies all that.
Block A Country is a free service that automatically generates a .htaccess with countries that you want to block. All you need to do is select the countries from the list and click the “Go” button. You will then need to create a .htaccess file at the root of your public html folder and paste the codes to that file. Do take note that the default code generated by Block A Country redirects the unwanted visitor to http://www.blockacountry.com/blocked.php
Country IP Blocks is similar to Block A Country but it allows you to choose CIDR (Classless Inter-Domain Routing), Netmask, IP Range, .htaccess deny, .htaccess allow, Decimal/CIDR, or Hex/CIDR. It will also tell you what’s the ISO code for the country, total networks and subnets in the list.
Once in a while the forum will be disturbed by a person named Gurjeet Singh Komal from Meerut, Uttar Pradesh India. He was probably the biggest fan of this website but backfired and turned into the biggest enemy because he was banned for not following the forum rules even after several warnings. He’d sign up a new account and start creating new threads by posting nonsense. It’s definitely unfair to block India from this site just because of him. As far as I know, there are many nice people from there too! Moreover it is also easy to get around this country banning restriction by using web proxy.
Related posts:
pity that the list is not complete,
i used a random free proxy to check if it worked and surprise…. the ip of the proxy wasnt in that list so i had full access.
how can we get a complete ip list sorted by country?
Hello Ray
very interesting information. I’ve been looking for this since for a long time. PLease tell me can I do all this on my blogger’s blog?
And how to check that country that you’ve selected is blocked or not?
Hi Ray,
I tried the sites above previously. But still prefer this one ip2location.com/blockvisitorsbycountry.aspx . At least they update their IPs all the time.
Besides, I also have the same question, can we block the whole country but give access to particular visitors?
Thanks!
my country is blocked 4rm dis website and i was wondering how 2 revoke the order
Hi i blocked my ecommerce website to india…but i wana give access to particular person.. how it is possible??
Please explain me in details.
thanks,
Karthik.
is there ANY way I can block all of Brazil from spamming me to my yahoo email? I never subscribed to anything from that country to that address and continuously receive loads of spam daily from different IP’s in Brazil. I have no one in Brazil and they have no business contacting me from there.
If they are from a known provider such as hotmail, I copy and paste full headers for them to remove the user, but sometimes they’re not, so I was wondering if there’s any way I can just block the entire country from accessing my yahoo mail. I know you understand that the ppl @ yahoo are completely incompetent when it comes to answering questions so I ended up here myself to see if anyone here knows.
THANKS!!! any help would be great (if at all possible to do this)
I really do appreciate what you do.I love the way you track down those precious freebies,sometimes from as far away as China .
In fact,you did get an award for that.This year.
Very good.
But this tool..That’s exactly,what the internet NOT should be.
Building up these frontiers again? Why,you off all people should be opposed to something like that.
I am really sorry about this.
@Candy +1
Thanks for another fantastic post hats off man, and please remember that there are many fans of ur fans esp from india :P
Block people visiting from certain countries is a dirty game! One people, one world. It’s like hidden racism. No bad nations, any country ha few bad people,not all.
Hi raymond
Which firewall you use for your real computer(not your test computer)?
You advise me which firewall is the best.
Thank Raymond
Thanks so much, Ray!
”As far as I know, there are many nice people from there too!” -this line touched my heart, thx ray…u r the best…Regards, Rohan, 1 of the biggest fans of Raymond
thanks for the information.
but,never ever think of banning india.
” As far as I know, there are many nice people from there too! ”
i loved this lines of yours Raymond.
u have given a great support to all of us and because of one we cant blame the whole of people.
Hey Ray,
thanks for the post. I would say same thing what others said india has lot of fans for raymond.cc.
I am runing a blog with avrage daily visit count with 700 visitors allover the world and I recomend only few website thier and one of those website is yours because I like to give quality content only to my visitor and whatever you write is almost uniqe no copy paste from any where.
Thanks for your nice and usefull articles
thanx.. for not blocking INDIA.. Ray
Lmao dont u ban india ud lose so many readers and massive fans like me.. Im sure he was the exception than the norm
Thanx 4 not blocking india ray..Even if you did, i would have most probably used a web proxy :P
so no one used a proxy server to buy the books ?
Hi Ray,
This month first week itself I faced the same page while trying to get the KIS 2010 Licence key from PC Magazine promotion page.
Checked today and the message shown :
“Access to this website had been denied.
Unfortunately, the owner of the website you wish to access decided to block visitors coming from your country.”
I haven’t tried using proxy.
But before they blocked their site, I managed to get a key, but when I tried to activate my KIS 2010, it said, key is black listed.
I’m activated trial licence and only 20 days left.
:(
[SOS]
I’m from Kerala, India and it is very sad to know that Gurjeet Singh didn’t followed the forum rules.
And never think of banning India..
;)
Regards,
Finson
God one Ray..
thanx for not blocking india ray….. coz m a gr88 fan of your posts..
thanx once again :)