.htpasswd 500 错误,完整路径正确
.htpasswd 500 error with correct full path
我需要用密码保护我的 HTML 页面 (admin.html),我正在使用 .htpasswd + .htaccess 文件
据我了解,没有必要在tag中写包含flder的htmk。
但我已经设置了 .htpasswd 的完整路径!那么,为什么这个 .htaccess - 文件会出现 500 错误?
<Files "admin.html">
AuthName "Username and password required"
AuthUserFile D:\Program Files (x86)\xampp\htdocs\news_back\client\.htpasswd
Require valid-user
AuthType Basic
</Files>
两个文件(admin.html 和 .htpasswd)都在 "client" 文件夹中。 (是的,我试过了<Files "client/admin.html">
)
.htpasswd 的内容:
管理员:$apr1$7n2mqwOp$INTz7H7lnL8dZVXlxcIu31
我的操作。系统是 Windows 7,我在本地 运行 XAMPP(使用 Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.5.24)。
只是猜测,我对基于 MS-Windows 的系统经验很少。但是这些典型的反斜线 spring 进入了眼睛。难道你必须逃避他们吗?因为在每个健全的系统上,反斜杠都有可能导致问题的特殊含义。与 space 字符、冒号 (:
) 和方括号 ((
,)
).
相同
尝试将文件放在命名风险较小的位置。只是作为一个测试。有用吗?
我需要用密码保护我的 HTML 页面 (admin.html),我正在使用 .htpasswd + .htaccess 文件
据我了解,没有必要在tag中写包含flder的htmk。 但我已经设置了 .htpasswd 的完整路径!那么,为什么这个 .htaccess - 文件会出现 500 错误?
<Files "admin.html">
AuthName "Username and password required"
AuthUserFile D:\Program Files (x86)\xampp\htdocs\news_back\client\.htpasswd
Require valid-user
AuthType Basic
</Files>
两个文件(admin.html 和 .htpasswd)都在 "client" 文件夹中。 (是的,我试过了<Files "client/admin.html">
)
.htpasswd 的内容: 管理员:$apr1$7n2mqwOp$INTz7H7lnL8dZVXlxcIu31
我的操作。系统是 Windows 7,我在本地 运行 XAMPP(使用 Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.5.24)。
只是猜测,我对基于 MS-Windows 的系统经验很少。但是这些典型的反斜线 spring 进入了眼睛。难道你必须逃避他们吗?因为在每个健全的系统上,反斜杠都有可能导致问题的特殊含义。与 space 字符、冒号 (:
) 和方括号 ((
,)
).
尝试将文件放在命名风险较小的位置。只是作为一个测试。有用吗?