我有一個簡單的PHP代碼中使用時,使用header
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
echo $_SERVER["SERVER_PROTOCOL"];
其送404,但curl
命令和強制1.0
,它返回ñ..
curl -0 -v 'http://www.example.com/test.php'
> GET /test.php HTTP/1.0
< HTTP/1.1 404 Not Found
< Server: nginx
< Date: Sat, 27 Oct 2012 08:51:27 GMT
< Content-Type: text/html
< Connection: close
<
* Closing connection #0
HTTP/1.0
正如你可以看到$_SERVER["SERVER_PROTOCOL"]
是1.0,但頭給我1.1
,是什麼原因?
@戈登,當你說它是重複的時候,請仔細閱讀。 – Ryan
你可以使用htaccess \ –