我想删除以下标题:
Connection: Keep-Alive
Server: Apache/2.2.13 (Win32)
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=66
Run Code Online (Sandbox Code Playgroud)
我不认为这可以在 PHP 中正确完成,因为这些标头是由 Apache 设置的。
There is PHP 5.3's header_remove() but that can remove only headers set by PHP (If I understand correctly). You could also overwrite the undesired headers by sending them again with empty values, but the original values will be sent anyway.
The best thing would be to fix this at the root, in Apache's configuration. For example, the ServerTokens directive can change the "Server:" header.
Related: apache_response_headers()
| 归档时间: |
|
| 查看次数: |
8855 次 |
| 最近记录: |