Search code examples
.htaccess.htpasswdddev

why is the .htaccess auth command not working in a directory in Drupal 9


i have a mini website below my sites default files directory and i am trying to make it be password protected with the following .htaccess file which i put in that same directory:

#Protect Directory
AuthName "Dialog prompt"
AuthType Basic
AuthUserFile /Users/dianacastillo/Projects/dam/web/sites/default/files/microsites/food-lineup/.htpasswd
Require valid-user

I also created an .htpasswd file in the same directory.

however when i browse to this directory from the site, it does not ask for any authentication. what could be wrong?


Solution

  • this didnt work because i was using ddev . ddev uses nginx, not apache , i switched to apache in the conf.yaml for ddev and now it works.