Welcome to WebmasterWorld Guest from 3.226.251.205

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

why ip blocking by .htaccess not working?

     
1:37 pm on Dec 22, 2006 (gmt 0)

New User

10+ Year Member

joined:Nov 14, 2006
posts:36
votes: 0


There is a line below in the root directory .htaccess file.
deny from catv161.avis.ne.jp

However I'm still seeing the number of hits is growing for the hostname, from the web statistics. Why is the blocking not working?

3:42 pm on Dec 22, 2006 (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


You're not blocking by IP here, you're blocking by hostname.

In order for this to work, HostNameLookups must be enabled in your server configuration.

Many hosts DO NOT enable this option, because a host name lookup requires that your server send a Reverse-DNS request to the DNS system for every single page/image/script HTTP request that your server receives. This adds considerably to the load on your server and on the host's network. Because your server must wait for a response to its RDNS request before serving anything to your visitor, it slows down your server as well. If the RDNS lookup fails, then your server may 'hang' for a long time, and your visitor will think that your site has failed.

Therefore, you may wish to use IP-address-based access control:


Deny from 202.247.193.161

[added] No mod_access solution will keep the requests from being logged by your server and appearing as 'hits' in your stats. To stop connections entirely, you must use a firewall. However, mod_access will stop this client from getting the data that they want from your server, so perhaps they will go away eventually. This client will receive a 403-Forbidden response to any request. 'Stats' are fairly useless for this kind of work: See your raw server access logs to verify that a 403-Forbidden response is being sent.[/added]

Jim

[edited by: jdMorgan at 3:46 pm (utc) on Dec. 22, 2006]

11:42 pm on Dec 22, 2006 (gmt 0)

New User

10+ Year Member

joined:Nov 14, 2006
posts:36
votes: 0


Thanks very much Jim.

I had a feeling that something is enabled yet for it to work, but I don't know much about server things. Now you gave me the perfect answer.

Merry Christmas and Happy New Year!