html - 405 在 Apache 身份验证中不允许获取
问题描述
我正在尝试为我的本地主机 Web 服务器创建一个身份验证表单,每次我试图让它工作时,我都会收到这个错误:
Method Not Allowed 请求的方法 GET 不允许用于此 URL。
好吧,我知道它不能考虑,但我真的不知道如何解决这个问题,我没有找到任何例子。任何帮助将不胜感激。
访问:
SetHandler form-login-handler
AuthFormLoginRequiredLocation "http://example.com/login.html"
AuthFormLoginSuccessLocation "http://example.com/admin/index.html"
AuthFormProvider file
AuthUserFile "conf/passwd"
AuthType form
AuthName /admin
Session On
SessionCookieName session path=/
还有我的 html 表单:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<form method="POST" action="/">
<input type="text" name="httpd_username" value="" />
<input type="password" name="httpd_password" value="" />
<input type="submit" name="login" value="Login" />
</form>
</body>
</html>
解决方案
推荐阅读
- excel - 如何根据用户输入生成日期列表?
- android - 位置请求优先或访问权限访问位置?
- windows - Microsoft Active Accessibility Direct Annotation 不适用于 Windows 10
- php - SimpleXMLElement - addChild 实例
- c++ - 当基类指针指向在基类中声明的派生类虚函数时,为什么会出现编译时错误?
- bash - Shell 脚本“for”循环语法
- excel - 如何从字符串中提取数字,如果有多个,将它们加在一起?
- javascript - 在 HTML 中输入带有 JS 的 NewLine
- maven - 添加本地外部 jar - 不应指向项目目录中的文件
- cloud-foundry - http/2 在 swisscom cloudfoundry 上?