22 May 2017

Got an unauthorized error from htaccess passwords after https redirection implementation. This was an unexpected result, but I guess what happens is that you are redirected to access denied page without getting the password prompt, due to access restriction and redirect simultaneous combination.

Source code viewer
  1. AuthType Basic
  2. AuthName "Username and password required"
  3. AuthUserFile /my/path/to/.passwd
  5. Order Deny,Allow
  6. Deny from all
  7. Satisfy Any
  8. Allow from env=!HTTPS
  9. Require valid-user
Programming Language: Apache configuration