.htaccess根本不起作用

bash_profile空白

通过输入http://www.mywebsite.com/myfile我可以通过网站访问该文件,并且该服务器在debian上运行。

我想在尝试访问以前的URL时使用.htaccess和.htpasswd进行身份验证。

我对.htaccess还是很陌生,我尝试使用doc对其进行配置,但是它似乎不起作用,因为当我尝试进行任何更改并检查错误日志时,我得到了:

[错误] [客户端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>

请问该如何解决?

bash_profile空白

看来删除并再次创建用户足以解决FTP连接问题。

我已使用以下命令修改了全局apache配置:

DirectoryIndex index.html index.htm index.xhtml index.php index.txt

ServerName debian.domain.tld
#ServerName localhost
HostnameLookups Off

ServerAdmin myadressemail

UserDir www
UserDir disable root

<Directory />
    Options -Indexes FollowSymLinks
    AllowOverride All
</Directory>

ServerSignature Off

现在我的.htaccess是:

AuthUserFile /home/file1/myfile/.htpasswd
AuthGroupFile /dev/null
AuthName "My authentification"
AuthType Basic
Require user user1

但是我仍然没有询问身份验证,我做错了什么?

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章