Set up Apache 2.0.x to allow access by incoming IP AND/OR password (htaccess)

Posted on 2006-05-08
Last Modified: 2011-09-20
Hi all,

I have a site on our Intranet that is currently wide open.  We need to add password controls to it so we can allow some people to see certain sub-directories of the site, but not everything.  The catch is, we'd like to bypass the password security if the incoming connection is from a particular IP range.

So what I'm wondering is if Apache 2.0.x allows this sort of "combo authorization" model.  Ideally, it should check the incoming IP address first.  If it is "allowed" then the user can connect without a password.  If it isn't in the allowed IP range, it performs a password check.

Any thoughts?  Does Apache 2.2.x support this?


Question by:masterbaker
    LVL 10

    Accepted Solution

    You can do this with Apache 2.0.  See the "Satisfy" directive.


    Require valid-user
    Allow from 192.168.1
    Satisfy Any

    LVL 13

    Author Comment

    Wow, so simple yet so effective. :)  I had to add a "deny all" as well, but that satisfy command was exactly what I needed.  Thank you so much!!!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now