gpt4 book ai didi

php - 使用 AuthType Basic 登录后的 .htaccess 500 错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:52:05 25 4
gpt4 key购买 nike

这是我的 .htaccess 文件:

AuthType Basic
AuthName "LOG IN"
AuthUserFile .htpasswd
Require valid-user

登录后,我收到 500 错误。如果我清除 .htaccess 文件,它就可以正常工作。

有什么想法吗?

最佳答案

我认为你必须写下你的 .htpasswd 的完整路径(在 linux 上:/path/to/.htpasswd)

来自 http://weavervsworld.com/docs/other/passprotect.html

Troubleshooting

Make sure that the path specified in AuthUserFile is the correct fullpath. This is a major cause of problems. If Apache cannot find the.htpasswd file, then all attempts will fail.

Make sure the permissionson the .htaccess and .htpasswd files are set so that Apache can readthem. chmod 0644 .htaccess chmod 0644 .htpasswd

Other issues may beout of your control. Web administrators can lock down Apache so thatit ignores all .htaccess files it encounters. This can be achievedwith an AllowOverride None directive and option on theServerRoot/DocumentRoot directories. If this is the case (.htaccessnot allowed) you will have to kindly ask your web administrator toallow .htaccess files with authorization directives in your personalweb directory. This can be achieved with AllowOverride AuthConfigdirective and option.

关于php - 使用 AuthType Basic 登录后的 .htaccess 500 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16807864/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com