.htaccess路径到.htpasswd导致内部服务器错误

时间:2014-11-03 20:52:35

标签: php .htpasswd

所以我几乎尝试了所有可能的路径,但每当我遇到内部服务器错误时,也许我忽略了一些人的想法?

.htacces的路径:/domains/domain.com/public_html/route/portfolio/inc

.htpasswd /domains/domain.com/public_html/route/portfolio/inc/etc

的路径

htacces:

AuthUserFile /public_html/route/portfolio/inc/etc
AuthName "Please Enter Password"
AuthType Basic
Require valid-user

提前致谢!

1 个答案:

答案 0 :(得分:0)

来自official documentation

The AuthUserFile directive sets the name of a textual file containing the list of users and passwords for user authentication. File-path is the path to the user file. If it is not absolute, it is treated as relative to the ServerRoot.

在您的情况下,路径被视为绝对路径,因为它以/开头。您必须将其更改为/domains/domain.com/public_html/route/portfolio/inc/etc./public_html/route/portfolio/inc/etc