Hiding PHP's X-Powered-By header

前端 未结 6 1965
太阳男子
太阳男子 2020-12-13 23:59

I know in PHP, it sends the X-Powered-By header to have the PHP version.

I also know by appending some checksums, you can get access to PHP\'s credits,

6条回答
  •  时光取名叫无心
    2020-12-14 00:55

    To get rid of the X-Powered-By header without having access to php.ini, simply add an empty header.

    
    

    This overwrites the default X-Powered-By header with an empty value an though most clients and applications act like this header was not sent at all.

    As noticed before, this must be inserted into the code before any output is sent.

    And to answer your question:

    Only your X-Powered-By header will be sent because it gets replaced by your header with the same name. So it can't be detected by a 'sniffer'.

提交回复
热议问题