FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Stopping Apache from Sending Headers





imagefree
How to stop apache from sending headers?
I have enabled mod_headers and used the following code in .htaccess

Code:
Header unset Date
Header unset Content-Type


but there headers are not unset. Infact its not unsetting any header and unset is not working at all.
set is working fine and i can add custom headers of my requirments.

Code:
Array
(
    [0] => HTTP/1.1 200 OK
    [Date] => Sat, 03 Jan 2009 00:08:43 GMT
    [Server] => Apache
    [Response] => Deleted
    [Author] => Hamid Sarfraz
    [Content-Length] => 0
    [Connection] => close
    [Content-Type] => text/html
)

Author is successfully added, but date and Content-Type are not removed.


help needed!
rvec
why would you want to remove them?
The browser also wouldn't know what to do with a file without any content type.
imagefree
rvec wrote:
why would you want to remove them?
The browser also wouldn't know what to do with a file without any content type.


just for knowledge Very Happy
I tested the unset keyword but failes. So, i am curious about the valid use of it.
albuferque
Maybe you're setting them in the wrong place. Check this link:

http://www.askapache.com/htaccess/using-http-headers-with-htaccess.html#http-headers-in-htaccess
sheedatali
Have you tried to remove trivial headers first? I would have thought that content-type is required for browser to know what garbage is being sent by the server. Browser can't just guess that it is HTML or TEXT or GIF bla bla bla.

Also try to set this in your apache config rather than .htaccess file, if that works then figure out why .htaccess is being read properly or read at all. Also ensure that module is loaded by using the command line to dump modules loaded. Check your log files to see what apache is saying, useful if the module is producing any errors etc. Hope this helps.
Related topics
Auto redirect your visitors to a different page
PHP: Feedback form issues.. help =P
Web Mailer, Create a "contact us" mailer
.htaccess problem
AJAX tutorial [2nd part now updated]
The better Part of the world and Al Quida
Apache
Image Download trough PHP?
Has anyone installed Moodle successfully?
Save as .html or .php
help for problem! how to do?
May I ask to enable or load the apache module
Hide PHP file extension
Interesting mistake - change extension on image
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.