全部禁用Apache的添加页眉 [英] Disable All Apache-Added Headers

查看:133
本文介绍了全部禁用Apache的添加页眉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Apache 2.2并安装在个人电脑上运行Windows 7的PHP 5.3.8,而我试图发送使用PHP的HTTP响应。但我意识到,Apache的自动增加了一些头文件,如日期:和服务器:在响应中。有没有什么办法,以prevent呢?我不想被Apache添加任何标题。

i have apache 2.2 and php 5.3.8 installed on my pc running windows 7, and i was trying to send http responses using the php. but i realized that apache automatically adds some headers like Date: and Server: in the response. is there any way to prevent this? i don't want any header to be added by apache.

在此先感谢

推荐答案

您可以阿帕奇的头输出通过设置你以下两行减少apache2.conf:

You can minimize the header output of Apache by setting the following two lines in you apache2.conf:

ServerTokens ProductOnly
ServerSignature Off

这将禁用服务器签名。 http://httpd.apache.org/docs/2.0/mod/core html的#serversignature

This will disable the servers signature. http://httpd.apache.org/docs/2.0/mod/core.html#serversignature

至于日期头,这是通过HTTP标准要求。

As for the Date header, this is required by the HTTP standard.

这篇关于全部禁用Apache的添加页眉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆