Welcome to WebmasterWorld Guest from 35.173.234.237

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

I'd appreciate a confirmation for an htaccess ban rule

banning a country by hostname with the risk of going too far

     
10:27 am on Jun 17, 2009 (gmt 0)

New User

10+ Year Member

joined:June 17, 2009
posts: 3
votes: 0


Hello,

Japanese users have become a problem on one of my websites, and I would need to ban japan on server level, with my .htaccess file.

However, the list of japanese IPs is almost 1780 lines long, that's a 47 kb text file !
I'm afraid a sole htaccess so big might become a problem, so I am trying to ban the japan on a hostname basis instead.

However - that's the reason I'm asking you guys for a confirmation -, in your opinion, ".jp", is it safe to ban such a short text string, or do you think there is a risk to accidentally have perfectly legitimate hostnames banned with it ?

The code I'm thinking of would be, very simply :

order allow,deny
deny from .jp
allow from all

Or else, if you know where a list of japanese hostnames exists (I spend a full hour searching without success), in order to ban hostnames like .co.jp or .ac.jp instead, you're more than welcome :)

Thanks for reading me, and thank you very much if you can help, I'll be grateful !

Oliver

12:49 pm on June 17, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 23, 2003
posts:915
votes: 0


if you know where a list of japanese hostnames exists

If you already have a list of japanese IPs, you could always do reverse look-ups to get the hostnames

Although I have no direct experience of Japan, judging by the way other countries and ISPs choose hostnames I would be *very* surprised if all the hostnames ended in .jp

12:57 pm on June 17, 2009 (gmt 0)

Senior Member

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

joined:Mar 31, 2002
posts:25430
votes: 0


Another approach is to make note of the IP address ranges (for example, those of ISPs) that are actually causing you a problem, and blocking only those. I suspect your list of 1780 IP ranges includes many ranges that are not actually a problem.

Hit the high spots, in other words.

You could also look at the referrers to see if one or only a few referrers are giving you problems.

Jim

1:53 pm on June 17, 2009 (gmt 0)

Senior Member

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

joined:Nov 11, 2001
posts:5506
votes: 5


The second line of this brief example [webmasterworld.com] will provide denial to the majority of APNIC visitors.