Vad*_*est 5 apache .htaccess http-headers
我尝试通过在OVH共享服务器中将以下内容添加到我的.htaccess 来禁用这两者X-Powered-By并Server解决安全问题.
<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>
Run Code Online (Sandbox Code Playgroud)
但它不起作用,我仍然在运行HTTP请求时获得这些标头.为什么?这是不可能的,因为某种程度上mod_headers.c没有加载到共享服务器上?
还有一个 PHP 函数可以做到这一点:
<?php
header_remove("X-Powered-By");
?>
Run Code Online (Sandbox Code Playgroud)
http://php.net/manual/en/function.header-remove.php
希望这有帮助
| 归档时间: |
|
| 查看次数: |
2934 次 |
| 最近记录: |