Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7937919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:39:23+00:00 2026-06-03T22:39:23+00:00

Is it possible to have an .htaccess/.htpasswd access control setup for a given directory,

  • 0

Is it possible to have an .htaccess/.htpasswd access control setup for a given directory, but if they are from a specific IP address, bypass the login/password authentication?

I know you can do something like this in the .htaccess file:

order deny,allow
deny from all
allow from 000.000.000.000

But if you add something along these lines:

AuthType Basic
AuthName "restricted area"
AuthUserFile /path/to/.htpasswd
require valid-user

Then it prompts for the password. Is there any way to do an if/else type setup, or some other solution so that users as a given IP (or set of IPs) don’t get prompted for a password, but everyone else does?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:39:24+00:00Added an answer on June 3, 2026 at 10:39 pm

    For versions 2.2.X you can use the following…

    AuthUserFile /var/www/mysite/.htpasswd
    AuthName "Please Log In"
    AuthType Basic
    require valid-user
    Order allow,deny
    Allow from xxx.xxx.xxx.xxx
    satisfy any
    

    Obviously replace the path to your usersfile and the ip address which you would like to bypass the authentication.

    Further explanation of the specifics, can be found at: http://httpd.apache.org/docs/2.2/howto/auth.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to have an htaccess rule that will redirect my files from
I have setup htpasswd authentication on my live site and it works great, but
Is it possible to have a relationship from a user table to a system
Is it possible to have Apache htaccess rewrites take effect before it hits django?
I have this .htaccess file but I would like it to only do this
Well this is really simple but I have no clue.. I have a htaccess
I have following in htaccess file: RewriteCond %{HTTP_HOST} ^(www.)?abcdef.com$ RewriteRule (.*)$ http://www.xyz.org.il/$1 [R=301,L] but
I have a small question to ask. Is it possible, via php or htaccess,
How do I create subdomain like http://user.mywebsite.example ? Do I have to access .htaccess
I have a directory protected by htaccess. Here is the code I use now:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.