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

  • Home
  • SEARCH
  • 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 8283901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:54:25+00:00 2026-06-08T10:54:25+00:00

Might there be a way to set one’s .htaccess file to prompt for authentication

  • 0

Might there be a way to set one’s .htaccess file to prompt for authentication each time? Example: I open a browser tab, go to the pw protected url, I’m prompted for a pw. Close the tab (main browser still open) and repeat the above and be prompted for the pw again. This is not happening unless I close the browser. Maybe this is a caching thing?

Here’s what I have so far:

AuthType Basic
AuthName "myName"
AuthUserFile "/home/myDir/.htpasswds/public_html/myName/passwd"
require valid-user

Thanks in advance.

  • 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-08T10:54:26+00:00Added an answer on June 8, 2026 at 10:54 am

    Actually it is working this way (simplified):

    • browser sends request to your server without credentials
    • Apache responses with 403 error because “require valid-user” was specified
    • browser prompts for username & password
    • browser sends request again, this time credentials are provided
    • Apache verifies credentials against AuthUserFile and sets “valid-user” accordingly
    • if everything is OK – puts out data with 200 status code
    • browser that receives 200 code caches used credentials for the relevant domain until browser session expires

    As you see – problem lays in browser. You cannot force browser to forget password it uses for a domain. And usually you don’t want to – for example if password protected page contains images – browser would require username and password for each downloaded image.

    However there are some tips you could try:

    • you could write your own Apache authorization handler that only authorises user every second time it is accessing the page; but it’s hard to do really
    • you could use some kind of form-based authentication (in script like php or asp.net) instead of relying on http authentication; this way is quite flexible
    • you could do a trick, that every time a protected page is accessed some kind of script changes the password in passwd file; then provide two passwords for each user and switch them on each request; this way browser always remember “wrong” password; it seems crazy but this is an easiest solution I could think of 🙂
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with JBoss 4.2.1GA . As you might now there is a way
I am hoping that there might be an easy way to do this, I
This might be simple or impossible ;-) Is there a way to restrict the
I realise there might be similar questions but I couldn't find one that was
I was just wondering, is there a way to set up gitosis so that
Is there a way to avoid or set up a schema to display better
Is there a way to cut one shape out of another in SVG? For
Is there any way to have a user defined parameter in a file and
In the one dimensional array S , There might be any number of elements
Is there a way of getting the Canonical Time Zone name from a Linux

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.