16 http apache-2.2
如何在 Apache Web 服务器上启用对 RFC 2616 中定义的所有 HTTP 方法的处理?这些将是:
OPTIONS
GET
HEAD
POST
PUT
DELETE
TRACE
CONNECT
Run Code Online (Sandbox Code Playgroud)
我使用的是 Apache HTTP Server,版本 2.2.22 (Ubuntu)
这是我的.htaccess文件:
<Location /output>
Dav On
<LimitExcept GET HEAD OPTIONS PUT>
Allow from all
</LimitExcept>
</Location>
Run Code Online (Sandbox Code Playgroud)
这是我从运行 Telnet 得到的输出——没有 PUT 方法:
Escape character is '^]'.
OPTIONS / HTTP/1.0
HTTP/1.1 200 OK
Date: Tue, 09 Oct 2012 06:56:42 GMT
Server: Apache/2.2.22 (Ubuntu)
Allow: GET,HEAD,POST,OPTIONS
Vary: Accept-Encoding
Content-Length: 0
Connection: close
Content-Type: text/html
Connection closed by foreign host.
Run Code Online (Sandbox Code Playgroud)
对此有何想法?