Question Locked

Block foreign country access to our site

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,

How can I block foreign country access to our website. I have traffic that comes from foreign countries and I want to block it.

Thanks

3 replies

by dr dij

research the country ranges using various internet lookup sites.

apnic, lacnic, ripe, etc

all let you see what the ranges are.

block them.

once you have 3/4 of the world blocked you may still see people from other countries getting in. people can use proxies in the country to bypass this.

so nothing is absolute.

I have a humongous website and dislike scraper bots. They often come from foreign countries. I tend to ban the whole IP range that the address resolves to.

I also ban US hosting companies, as these typically are all servers, NOT end users. There is generally no valid reason any server should access your site, unless is a bot. YOu may want to let google, yahoo and other selected bots in.

you ban address ranges from your control panel or in your .htaccess file I think is called.

goto webmasterworld forums for more specifics.

some will tell you is great idea, others will tell you how foolish you are to try.

I ban whole ISP ranges if servers, for example a bot in singapore's general range hit me so I didn't ban the whole range, just the address they came from.

bots hitting your site (look at your raw access logs) are a treasure trove for finding hosting sites to ban or servers that have been compromised to ban.

I write down the specific address I banned, the range it came from and name, when I banned it and why, and keep this in a spreadsheet as the IP Deny in your control panel doesn't have space for comments.

I think I'm up to 3 or 4 hundred ranges and addresses so far.

On my site is really easy to see from access patterns if a real user or a bot.

typically they don't request media such as .jpegs.

one other thing you can do is not allow direct access to media files, only allow them from YOUR site. This is called leach control and is on the control panel. typically only bots would try to access your content, such as .jpeg or other media scrapers.

you may want to allow direct access to .pdf files but not .jpegs for example.

by jamjube

Thanks so much. We will investigate and again thanks for pointing us in the right direction.

This discussion is closed to new replies.