Skip to content
Advertisement

can not hide X-Powered-By with expose_php

I want to hide my php version in response headers and for that I changed expose_php to off but it does not work
My php.ini file

and I added Header unset X-Powered-By to my htaccess file but in did not work either can you guide me for that?

Advertisement

Answer

and I added Header unset X-Powered-By to my htaccess file but in did not work either

Depending on which group the X-Powered-By header has been set, you may need to use the always condition (instead of the default onsuccess). For example:

Header always unset X-Powered-By

You can also try removing the header from within PHP itself. For example:

<?php
header_remove('X-Powered-By');

Reference:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement