Welcome to WebmasterWorld Guest from 184.73.3.107

Forum Moderators: Ocean10000 & incrediBILL & phranque

Preventing access from specific countries?

   
6:10 pm on Oct 7, 2007 (gmt 0)

5+ Year Member



How can I prevent specific countries (for example, Ghana in Africa) from accessing our website? What exactly do I enter into our .htaccess file?

Thank you,
Ron

6:29 pm on Oct 7, 2007 (gmt 0)

WebmasterWorld Senior Member wilderness is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



go to ARIN and do a search on "African Network Information Center" and IP ranges provided will at least give you a beginning of what ranges to deny.

as to creating an htaccess file?
Some old threads:
[webmasterworld.com...]
[webmasterworld.com...]
[webmasterworld.com...]

Some tutorials/guides for htaccess:
[baremetal.com...]
[evolt.org...]
[edginet.org...]
[javascriptkit.com...]
[serverwatch.com...]
[brainstormsandraves.com...]
[the-art-of-web.com...]

6:41 pm on Oct 7, 2007 (gmt 0)

5+ Year Member



Wilderness,
Thanks very much for the information and links!

BTW...is using the .htaccess file the only efficient way to deny access to countries or malicious visitors? Is there a better method?

Thanks,
Ron

7:52 pm on Oct 7, 2007 (gmt 0)

WebmasterWorld Senior Member wilderness is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



htaccess the only way that I'm aware of on a "hosted" website.

If you have your own server, http.conf is more appropiate.

My widegts are exclusive to North America and I have most every non-NA range denied, however that was accomplished gradually and the providing the ranges to another would not be possible.

There are some websites, which you may go to an download entire ranges for specific countries, however these numbers change frequently.
Even with the files downloaded, your still faced with the tedious process of converting the IP ranges to rewrites.

1:51 pm on Oct 8, 2007 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Note that many of those same "IP range sites" also offer paid services. These services track the ever-changing map of IP addresses to countries, and provide you with updated data.

Many provide two kinds of service; One where your server makes a call to their server to check a requesting IP address, and another where you periodically download updates from their database to your server, and all checking occurs locally on your server (which is *much* faster). Do a search for "GeoIP" to turn up more info.

Jim

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month