Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache .htpasswd 500错误,完整路径正确_Apache_.htaccess_.htpasswd - Fatal编程技术网

Apache .htpasswd 500错误,完整路径正确

Apache .htpasswd 500错误,完整路径正确,apache,.htaccess,.htpasswd,Apache,.htaccess,.htpasswd,我需要用密码保护我的HTML页面(admin.HTML),并且我正在使用.htpasswd+.htaccess文件 据我所知,没有必要在标记中编写包含flder的htmk。 但我已将完整路径设置为.htpasswd!那么为什么这个.htaccess文件会出现500个错误呢 AuthName“需要用户名和密码” AuthUserFile D:\Program Files(x86)\xampp\htdocs\news\u back\client\.htpasswd 需要有效用户 AuthType

我需要用密码保护我的HTML页面(admin.HTML),并且我正在使用.htpasswd+.htaccess文件

据我所知,没有必要在标记中编写包含flder的htmk。 但我已将完整路径设置为.htpasswd!那么为什么这个.htaccess文件会出现500个错误呢


AuthName“需要用户名和密码”
AuthUserFile D:\Program Files(x86)\xampp\htdocs\news\u back\client\.htpasswd
需要有效用户
AuthType Basic

这两个文件(admin.html和.htpasswd)都位于“客户端”文件夹中。(是的,我试过

.htpasswd的内容: 管理:$apr1$7n2mqwOp$INTz7H7lnL8dZVXlxcIu31


我的操作系统是Windows 7,我在本地运行XAMPP(使用Apache/2.4.12(Win32)OpenSSL/1.0.1l PHP/5.5.24)。

仅凭猜测,我对基于MS Windows的系统几乎没有经验。但这些典型的后斜线直入眼睛。是不是你必须逃离他们?因为在每一个健全的系统上,反斜杠都有一个特殊的含义,可能会导致问题。与空格字符、冒号(
)和括号(
)相同


请尝试将文件放在命名风险较小的位置。作为一种测试。这样行吗?

谢谢你的建议!路径有点奇怪(这里可能是空格…),我把.htpasswd文件放进了D;这很有帮助!所以在这里把你的建议作为答案,我会把它标记为正确的。