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 8851507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:10:20+00:00 2026-06-14T13:10:20+00:00

The root folder of a web app is protected with a .htaccess/.htpasswd file. That

  • 0

The root folder of a web app is protected with a .htaccess/.htpasswd file. That works fine even with sub-folders, and everything is perfect.

Now I have to password protect a subfolder using a different .htpasswd file. I tried using a new .htaccess/.htpasswd combo into the subfolder and it kinda works, except for the fact that I need to enter two usernames and passwords (one for the subfolder and one for the .htaccess/.htpasswd in the root folder).

Is there a way to avoid that?

Thanks

  • 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-14T13:10:21+00:00Added an answer on June 14, 2026 at 1:10 pm

    There is no straight-forward way to do that.
    My solution would be to explicitly define the directories that require valid user (using the root .htpasswd), and exclude the directory which has its own authentication.
    ex:

    .htaccess (root)
    AuthUserFile /full/path/to/.htpasswd
    AuthType Basic
    AuthName "My Secret Page"
    
    <Directory "/var">
      Require valid-user
    </Directory>
    
    <Directory "/etc">
      Require valid-user
    </Directory>
    

    In the subfolder ex “/users” you’ll place the custom .htaccess and .htpasswd which will manage the authentication.

    Of course always check if your user entry in the .htpasswd is supported by the operating system.

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

Sidebar

Related Questions

I had a file upload that was uploading to a folder in the web
Is it possible to hide the folders in my root folder? Just in case
I want to use a JavaScript file, lying in the root folder. How can
There is a file called 'format' in the root repository folder. It contains the
I have a simple web application that contains a folder called documents on the
I have a web app that has search functionality. The search algorithm is compiled
When putting logback.xml in src/main/resources/ folder of my web-application, its working fine. However, when
I have a litte web app which works properly when deployed to the App
I have written a web app where the JS file lots of relative calls
I am using code that will get the root path return HttpContext.Current.Server.MapPath(@\Schedules\); This works

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.