Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    htaccess allow ip-range and users

    Hi, I've been looking for a script for htaccess but I could only find pieces. I don't know if it can be combined.
    this is what I want to accomplish:
    I want to allow access from the ip-range 134.xxx.xxx.xxx and request authentication if the visitor is outside this range.

    I can use this code to request authentication:
    Code:
    AuthName "Restricted area"
    AuthType Basic
    AuthUserFile /full/path/to/.htpasswd
    Require valid-user
    and something like this to allow the ip-range 134.xxx.xxx.xxx:
    Code:
    <Limit GET HEAD POST> 
    order allow,deny 
    allow from 134
    deny from all
    </LIMIT>
    any body knows how I can combine this?

    Johan

  • #2
    Regular Coder
    Join Date
    May 2004
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Never tried this, but I think you need the Satisfy directive.

    Code:
    Order Deny,Allow
    Deny from all
    Allow from 134.
    AuthType Basic
    AuthUserFile /full/path/to/.htpasswd
    AuthName "Restricted Area"
    Require valid-user
    Satisfy any
    This should allow users from the 134. Ip range and request authentication from other users.

    For more info, see the Apache Core features:
    http://httpd.apache.org/docs/mod/core.html


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •