我已将 Apache 配置为对使用动词发出的所有请求返回 200 OPTIONS
:
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
Apache 确实返回了状态200 OK
,但主体包含一条错误消息:
HTTP/1.1 200 OK
Date: Sun, 22 Mar 2015 16:38:10 GMT
Server: Apache/2.4.10 (Win64) PHP/5.6.3
Content-Length: 492
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>200 OK</title>
</head><body>
<h1>OK</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at
[email protected] to inform them of the time this error occurred,
and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>
为什么这样?配置不正确吗?
答案1
@Maximus,您必须使用“204-No Content”作为响应代码。