通过键入http://www.mywebsite.com/myfile可以通过我的网站访问一个文件,并且服务器在 debian 上运行。
我想在尝试访问以前的 url 时使用 .htaccess 和 .htpasswd 进行身份验证。
我对 .htaccess 很陌生,我尝试使用文档对其进行配置,但它似乎不起作用,因为当我尝试没有任何更改并且当我检查错误日志时,我得到了:
[错误] [客户端 IP] 客户端被服务器配置拒绝:/home/file1/myfile/www/.htaccess
我的 .htaccess 的内容是:
<Directory /home/file1/myfile/www/>
AuthUserFile /home/file1/myfile/.htpasswd
AuthGroupFile /dev/null
AuthName "My authentication"
AuthType Basic
Require valid-user
Otions Indexes FollowSymLinks Multiviews
AllowOverride All
Order allow,deny
allow from all
Redirect permanent /.htaccess http://www.mywebsite.com/myfile
ServerSignature Off
</Directory>
请问我该如何解决这个问题?