即使正确配置,.htaccess 也会被忽略

即使正确配置,.htaccess 也会被忽略

我很生气:

<VirtualHost *:8080>
  ServerAdmin [email protected]
  ServerName ec2-52-36-220-163.us-west-2.compute.amazonaws.com

  DocumentRoot /var/www/wordpress
  <Directory />
      Options FollowSymLinks
      AllowOverride None
  </Directory>

  <Directory /var/www/wordress>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
      Order allow,deny
      allow from all
  </Directory>

#mariadb
  <Directory /var/www/wordress/mydbadmin>
          AllowOverride AuthConfig
          # The Options below is an example. Use what you deem is necessary.
          Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
          Order allow,deny
          Allow from all
  </Directory>


</VirtualHost>
AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/var/www/wordpress/mydbadmin/.htpasswd"
Require valid-user

忽略 htaccess 中的 bunk,试图生成一个错误来查看它是否未被读取。

答案1

您声明的目录 ( /var/www/wordress/mydbadmin) 不存在,因此什么也没有发生。我猜是打字错误。改正它,wordress-> wordpress( /var/www/wordpress/mydbadmin) 然后看看。

<Directory /var/www/wordpress/mydbadmin>
        AllowOverride AuthConfig
        # The Options below is an example. Use what you deem is necessary.
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        Order allow,deny
        Allow from all
</Directory>

相关内容