Reply
Blocking all IP's except US & Canada
Old 07-13-2007, 01:01 PM Blocking all IP's except US & Canada
Novice Talker

Posts: 10
Name: Cody Singsaas
I am looking to make changes to my .htaccess file so that all ip addresses are set to deny and I will explicitly allow only ip addresses from the US & Canada. I am able to discern which IP addresses are allocated to these two countries from the following URL:

http://www.ipmaster.org/ranges.php

I have two questions however.

1) How often are ip addresses reallocated, moved or added to a specific countries range of ip's? For instance, is there ever a conceiveable scenario where the US would take over an IP block that was previously allocated to Mexico? Will specific US IP ranges ever fall out of service or move to new countries? Are all IP addresses accounted for? Will the US be adding new IP's moving forward that did not exist (i.e. were not previously allocated to any other country)?

2) This will require a good number of entries in my .htaccess file. Will this in effect slow down the web site for all US & Canada users to the point where I will loose any benefit I will have received from keeping undesireables out?
__________________
IE Internet Solutions / Cody Singsaas (President)
Low cost web hosting from a trusted provider
URL http://www.ieinternetsolutions.com / Email cody@ieinternetsolutions.com
csingsaas is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 07-13-2007, 05:56 PM Re: Blocking all IP's except US & Canada
Banned

Posts: 253
Name: Michel Samuel
Your .htaccess file will be beyond huge !

Therefore...
1) Download the free maxmind database. Or pay for the really good one.
2) Setup msql with your IPs.
3) Use a script that can be called from each page.

Faster...
Cleaner....
Less work...
Michel Samuel is offline
Reply With Quote
View Public Profile
 
Old 07-14-2007, 07:06 AM Re: Blocking all IP's except US & Canada
damien_ls's Avatar
Layershift

Posts: 435
Name: Damien
Take a look at this old thread which is pretty similar: GeoIP blocking of countries

It should get you going in the right direction...

What's your motivation for wanting to block all other traffic? There are always some anomalies which aren't accounted for, so I expect you'll probably block a small % of traffic which is "genuine" and let others (e.g. UK AOL users for a start) through as US visitors.
__________________
Layershift :: DDS & Dedicated, UK & USA-based Managed Virtuozzo VPS, Reseller & Shared Hosting
Experienced Parallels Platinum Partners (Plesk since 2001, Virtuozzo since 2004)
damien_ls is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Blocking all IP's except US & Canada
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11499 seconds with 12 queries