0

I have a list of ip which doesn't require login prompt ... I have a list of banned ip ( no prompt juste deny access ) But i need a prompt for all others ip ...

I tried this :

AuthType Basic
AuthName "Restricted Area"
AuthUserFile .htpasswd
Require valid-user

Order Deny,Allow
Deny from all

Allow from 82.xxx.xxx.xxx

Deny from 109.xxx.xxx.xxx
Deny from 109.xxx.xxx.xxx
Deny from 109.xxx.xxx.xxx

Satisfy any

But if you come on with a banned ip, you have the prompt ... if you change Satisfy ( "Satisfy all" ) you have the prompt on allowed ip ...

1 Answer 1

0

i found a trick for my problem :

Order Allow,Deny
Allow from all

Deny from 109.xxx.xxx.xxx
Deny from 109.xxx.xxx.xxx
Deny from 109.xxx.xxx.xxx

<IfModule mod_rewrite.c>
    RewriteEngine On

    <If "%{REMOTE_ADDR} != '82.xxx.xxx.xxx'">
        AuthType Basic
        AuthName "restricted area"
        AuthUserFile /var/www/.htpasswd
        require valid-user
    </If>
</IfModule>
Satisfy All

But this solution work only on apache >= 2.4 because IF statement isn't supported by older version ....

do you have any others solutions for apache 2.2 ??

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .