htaccess doesn't work - always wrong password

前端 未结 9 2327
盖世英雄少女心
盖世英雄少女心 2020-12-15 04:04

I am trying to password protect a directory, and have two files in the directory which should password protected it:

  • .htaccess
  • .htpasswd
<
9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-15 04:17

    There's a small chance you're seeing password protection from a parent folder, not the folder you expect.

    If your /etc/apache2/sites-enabled folder has only one file in it, check to see if it has a section for your sites folder, something like:

    
       AllowOverride All
     
    

    otherwise, if it has a file for your site name, like:

    /etc/apache/sites-enabled/YOUR_SITE_NAME_HERE.conf

    edit that file instead, and make sure that there's an

    AllowOverride All
    

    in there. That's the important part! If you want to only allow the minimum, specify:

    AllowOverride AuthConfig
    

    instead.

提交回复
热议问题