PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
superdez
Forum Commoner
Posts: 33 Joined: Tue Jul 03, 2007 1:36 pm
Post
by superdez » Tue Jul 10, 2007 3:23 pm
Is there any way to replace the Server header ?
Code: Select all
<?php
header('Server: Red Hat Linux', true,);
?>
superdez
Forum Commoner
Posts: 33 Joined: Tue Jul 03, 2007 1:36 pm
Post
by superdez » Tue Jul 10, 2007 3:30 pm
Yes, it doesn't replace my default one.
Any ideas ?
Ollie Saunders
DevNet Master
Posts: 3179 Joined: Tue May 24, 2005 6:01 pm
Location: UK
Post
by Ollie Saunders » Tue Jul 10, 2007 3:34 pm
It never occurred to me to do that but I just tried it and it didn't work. Your best bet it to use mod_security and read
this .
In order for this directive to work you must leave/set ServerTokens to Full.
This is because mod_security writes directly over memory concerned to achieve this and enough memory has to be allocated in the first place.
superdez
Forum Commoner
Posts: 33 Joined: Tue Jul 03, 2007 1:36 pm
Post
by superdez » Tue Jul 10, 2007 3:44 pm
I don't have access to httpd.conf only .htaccess but anyway isn't PHP called after, so it should "override" it ?
I can use php to override an error header (say change 403 to 404), so why can't I override a server header ?
Ollie Saunders
DevNet Master
Posts: 3179 Joined: Tue May 24, 2005 6:01 pm
Location: UK
Post
by Ollie Saunders » Tue Jul 10, 2007 6:07 pm
I doubt very much it will. There's a specific reason why that feature was implemented in mod_security.