Score:0

Basic Authentication in .htaccess with RequireAll in httpd.conf

ke flag

Running Apache 2.4.53 - I have a setup where in httpd.conf I have:

<Location />
  <RequireAll>
    Require all granted
    Require not env something
    Require not ip 1.2.3.4
  </RequireAll>
</Location>

The above is supposed to run cross VH. Then, in a specific folder, of a specific VH, I have a single .htaccess which introduces BA with a simple:

AuthType Basic
AuthName "BA"
AuthUserFile "file123"
Require valid-user

If I comment the Location block, BA works. This should afaik prove BA is working per se (i.e. AllowOverrides are ok as set in the VH conf). If I don't comment the Location block, BA doesn't work.

How can I make this setup work without moving the BA logic inside the httpd.conf which I don't want to do?

PS: I suspect that the Require in the .htaccess is treated as a RequireAny clause compared to the RequireAll but I don't know how to fix it.

Thanks

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.