这是我的.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 full
path. This is a major cause of problems. If Apache cannot find the
.htpasswd file,then all attempts will fail.
Make sure the permissions
on the .htaccess and .htpasswd files are set so that Apache can read
them. chmod 0644 .htaccess chmod 0644 .htpasswd
Other issues may be out of your control. Web administrators can lock down Apache so that it ignores all .htaccess files it encounters. This can be achieved with an AllowOverride None directive and option on the ServerRoot/DocumentRoot directories. If this is the case (.htaccess not allowed) you will have to kindly ask your web administrator to allow .htaccess files with authorization directives in your personal web directory. This can be achieved with AllowOverride AuthConfig directive and option.