Forum Moderators: phranque

Message Too Old, No Replies

Syntax for denying a list of IP ranges in .htaccess

mod_access "Deny from" syntax question

         

skateboard

6:30 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



Howdy folks,
I have a list of about 100 IP rangess I want to deny in my .htaccess file, and my question is about syntax.

Do I need to write
Order Allow, Deny
allow all
deny 1.2.3.4/20
deny 1.3.4.5/20
etc....

Or can I write
Order Allow, Deny
allow all
deny(all,[
1.2.3.4/20
1.3.4.5/20
])

What is the delimeter between IPs in this type of expression? Are the parens and square brackets correct?

Thanks,

jdMorgan

2:58 pm on Feb 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've never seen that syntax before, at least not in the mod_access documentation [httpd.apache.org]. The accepted syntax is to use a space-delimited list, and "from" is required:

Order Allow, Deny
Allow from All
Deny from 1.2.3.4/20 192.168.0.10 127.0.0 10.1.0.0/255.255.0.0

Jim