allowing only specific IP range to area on my website

zimu

Diamond Member
Jun 15, 2001
6,209
0
0
hey guys,

is there some way i can restrict a certain folder in my webserver to only a certain range of IP addresses? any other ip address just gets an error message?
 

zimu

Diamond Member
Jun 15, 2001
6,209
0
0
try trygve, i checked out the mod_access. its not clear as to where i can put the "Allow from IPADDRESS" code. i tried to put it in htaccess, with a foreign IP address and i could still login fine, so i'm guessing i'm doing something wrong...
 

Trygve

Golden Member
Aug 1, 2001
1,428
9
0
Originally posted by: zimu
try trygve, i checked out the mod_access. its not clear as to where i can put the "Allow from IPADDRESS" code. i tried to put it in htaccess, with a foreign IP address and i could still login fine, so i'm guessing i'm doing something wrong...

Those would go in the appropriate section of httpd.conf. The syntax for .htaccess is different:

order allow,deny
allow from [insert ip block here]
deny from all

(switch the order directive if you want to block only specific ranges)

I've never tried it, but there's an htaccess generator available at http://www.bitesizeinc.net/demo.htaccesser.html
 

zimu

Diamond Member
Jun 15, 2001
6,209
0
0
ok still having issues. modified my .htaccess to prevent certain ip's from accessing site:

order deny,allow
deny from 150,69,81
Allow from all


its SUPPOSED to block ips starting with 150, 69 etc. but nope, users log on without problem.

 

Trygve

Golden Member
Aug 1, 2001
1,428
9
0
Originally posted by: zimu
ok still having issues. modified my .htaccess to prevent certain ip's from accessing site:

order deny,allow
deny from 150,69,81
Allow from all


its SUPPOSED to block ips starting with 150, 69 etc. but nope, users log on without problem.

Have you tried:

order deny,allow
deny from 150.
deny from 69.
deny from 81.
Allow from all