Forum Moderators: phranque

Message Too Old, No Replies

wildcard for "who can get stuff from this server"

         

brotherhood of LAN

9:00 pm on Nov 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have this in my http.conf on my localhost, for me and a couple of others to grab files from my server

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from localhost 127.0.0.1
Allow from localhost 123.123.123.123
Allow from localhost 123.123.123.124
</Directory>

Is there a character I can use for wildcards? I already tried 123.123.* to let a certain ISP gain access but that didn't work....

Cheers in advance.

jdMorgan

9:10 pm on Nov 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can't really use a wildcard directly, but you can leave off digits on the right-hand end...
Deny from 123.45

effectively means "Deny from 123.45.0.0 through 123.45.255.255"

That should work for your ISP application.

For others, you can use SetEnvIfMatch to set an environment variable for testing by Allow or Deny directives, allowing you to use regular expressions for pattern matching:


SetEnvif Remote_Addr ^123\.45\.[3-5]\. allowem
...
Order Deny,Allow
Allow from env=allowem

That allows access from the IP range 123.45.3.0 through 123.45.5.255, allowing for "finer resolution" of the allowed range.

Jim

brotherhood of LAN

9:13 pm on Nov 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Cheers Jim,

Quick and concise answer, needed and appreciated - cheeers!