PDA

View Full Version : Using .htaccess with list of IPs


Strok
01-13-2003, 08:12 PM
AuthUserFile /path/.htpasswd
AuthGroupFile /dev/null
AuthName "No access"
AuthType Basic
<Limit GET POST>
require valid-user
order deny,allow
deny from all
allow from 00.000.000.01 00.000.000.02
</Limit>

Anyone knows how to load "allow from 00.000.000.01 00.000.000.02" from separate file ?

Thanks

freddycodes
01-13-2003, 09:08 PM
This is not tested but did you try


<Limit GET POST>
require valid-user
order deny,allow
deny from all
Include iplist.conf
</Limit>


iplist.conf

allow from 00.000.000.01 00.000.000.02


I didn't try it but I use Include to include my virtual hosts containers in my httpd.conf from an external file so it might work. You might also haev to put it in your httpd.conf inside the virt hosts container instead.

Strok
01-14-2003, 05:42 AM
Include iplist.conf
and
Include /full_path/iplist.conf
wont work.
I can't make any changes in httpd.conf because I need to change the access just for few DIRs
PS
I wont use any CGI scripts for security reasons

freddycodes
01-14-2003, 05:46 AM
I wont use any CGI scripts for security reasons

What do you mean by this?

Include is an apache directive.

I would have a look at modrewrite then.

Strok
01-14-2003, 05:54 AM
I ment that there's an option to use a CGI

freddycodes
01-14-2003, 06:05 AM
For what? To only allow certian ips to certian directories?

Again I would have a look at modrewrite.