Welcome to WebmasterWorld Guest from 50.17.114.227

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

IP ranges in .htaccess

     
5:56 am on Mar 16, 2007 (gmt 0)

Full Member

10+ Year Member

joined:Jan 14, 2006
posts:222
votes: 0


Can you block ip ranges in the .htaccess like

deny from ###.###.###.### - ###.###.###.###?

I thought you could, but I have ip's accessing a site, that are in the range I blocked.

8:17 am on Mar 16, 2007 (gmt 0)

Preferred Member

5+ Year Member

joined:July 25, 2006
posts: 460
votes: 0


Yes you can, but not using that format. Search for "CIDR" or "netmask".
11:50 am on Mar 16, 2007 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12533
votes: 0


Details on how to do so can be found in the Apache manual pages under the Allow [httpd.apache.org] directive.
12:00 pm on Mar 16, 2007 (gmt 0)

Senior Member

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

joined:Apr 15, 2003
posts:7242
votes: 0


I don't mean to take this off track, but blocking a range of IP's, if for the long term, is much more efficiently handled in IPtables (or your firewall if this is a Windows server).

TJ

2:47 pm on Mar 16, 2007 (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


> off track

... but most Webmasters are on shared virtual hosting, and have no access to IPtables, firewalls, or anything beyond the limited .htaccess controls -- Which is why we do a big business here in .htaccess issues, and relatively little in server config discussion.

As stated above, the documentation for the Allow directive in mod_access enumerates the various methods for specifying IP address ranges.

Jim

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members