我想在回應頭中隱藏我的php版本,為此我將expose_php更改為關閉,但它不起作用

我在我的 htaccess 檔案中添加了Header unset X-Powered-By,但也沒有作業,你能指導我嗎?
uj5u.com熱心網友回復:
我添加
Header unset X-Powered-By到我的 htaccess 檔案中,但也沒有作業
根據已設定標頭的組,您可能需要使用條件(而不是默認值)。例如:X-Powered-Byalwaysonsuccess
Header always unset X-Powered-By
您也可以嘗試從 PHP 本身中洗掉標頭。例如:
<?php
header_remove('X-Powered-By');
參考:
- https://httpd.apache.org/docs/current/mod/mod_headers.html#header
- https://www.php.net/manual/en/function.header-remove.php
uj5u.com熱心網友回復:
當我在我的本地主機中嘗試時,關閉值對我不起作用,而是關閉對我有用,看起來它區分大小寫
注意:需要重啟服務器
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/459212.html
