![即使正确配置,.htaccess 也会被忽略](https://linux22.com/image/679124/%E5%8D%B3%E4%BD%BF%E6%AD%A3%E7%A1%AE%E9%85%8D%E7%BD%AE%EF%BC%8C.htaccess%20%E4%B9%9F%E4%BC%9A%E8%A2%AB%E5%BF%BD%E7%95%A5.png)
我很生气:
<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>
- htaccess:http://termbin.com/kjw1
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>