Help - Search - Members - Calendar
Full Version: .htaccess file for restricting certain countries from viewing your site
The Planet Forums > General > The Lounge
cmafia
Click Here For The Site

This is the kewlest thing!

Cajun
runik
neat!
gaurav
hmmm...wonder how it will block IP addresses? Also forgets to add that HostNameLookups will have to be set to on. Very bad idea!
winston
If it works by hostname, it will be mostly ineffective. Many (lame, IMHO) ISPs don't have PTRs for their dialups (so all you get is an IP address) and many more ISPs just use the generic .net TLD rather than their country code TLD.

The only way you can bar access by country is to have a database of netblocks and where they are, and block according to IP address.
cmafia
Hmmmm.....After reading more, this script is kinda lame. It only bans if the TLD is using a country code TLD like .it for Italy or .ca for Canada. Oh well!

Cajun
jaume
QUOTE
Originally posted by winston
The only way you can bar access by country is to have a database of netblocks and where they are, and block according to IP address.


Here's a link to IP databases I use to target banner ads:
http://www.idefense.com/Intell/CI022702.html

Anyone got more sources where to get other databases?icon_razz.gif
mv_
QUOTE
Originally posted by cmafia
Click Here For The Site  

This is the kewlest thing!  
Cajun


Why the heck is Slovak Republic in the list of defaultly banned countries? Everything from former communist's block is bad and deserves to be banned? ;-( I have lot of clients there, i'm here..
gaurav
QUOTE
Originally posted by mv_


Why the heck is Slovak Republic in the list of defaultly banned countries? Everything from former communist's block is bad and deserves to be banned? ;-( I have lot of clients there, i'm here..


Don't make a fuss out of it mv icon_smile.gif Good system admins will never do that.
jaume
QUOTE
Originally posted by gaurav

Don't make a fuss out of it mv icon_smile.gif Good system admins will never do that.


I agree. Also would deny from a firewall because is easy to fool that .htaccess

Remember also that most Hack attacks come from compromised servers located everywhere .. not only on some countries.
mv_
QUOTE
Originally posted by gaurav


Don't make a fuss out of it mv icon_smile.gif Good system admins will never do that.

I was just p*ssed when I saw it in bold. :-) This happened two times that my cc was refused because of the regione where I live and friends account with domainname registrator was canceled because of it too.

I know this is off-topic and should not be here.. I just don't like it :-)
gaurav
I agree with you on the points mv_. Hey!! who knows it better than me and rackshack??? I have been having a debate about my credit card with rackshack for the last 10 days now! The whole Internet accepts my credit card but RS won't. But neither of us control the business practices/policies of all the companies around the globe icon_smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.