如何使用 apache 在 OVH 相互化服务器上​​禁用 X-Powered-By?

2024-01-01

我尝试禁用两者X-Powered-By and Server出于安全考虑,将以下内容添加到 OVH 交互服务器中的我的 .htaccess 中。

<IfModule mod_headers.c>
  # Security disable headers. http://www.shanison.com/2012/07/05/unset-apache-response-header-protect-your-server-information/
  Header unset Server
  Header unset X-Powered-By
</IfModule>

但它不起作用,我在运行 HTTP 请求时仍然得到这些标头。为什么?这是不可能的,因为不知何故 mod_headers.c 没有加载到共同服务器上?


还有一个 PHP 函数可以做到这一点:

<?php
header_remove("X-Powered-By");
?>

http://php.net/manual/en/function.header-remove.php http://php.net/manual/en/function.header-remove.php

希望这有帮助

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用 apache 在 OVH 相互化服务器上​​禁用 X-Powered-By? 的相关文章

随机推荐