PHP: Block all http headers

Posted on 2011-05-05
Last Modified: 2012-05-11
I don't want PHP or Apache to send out ANY headers at all.

Using PHP, how can I block or prevent all standard headers?
Question by:hankknight
    LVL 8

    Assisted Solution

    You can overwrite the headers by yourself using the header() function.
    Deleting the headers, i don't think that is possible.
    LVL 107

    Assisted Solution

    by:Ray Paseur
    Can you tell us a little more about why you want to do this?  It certainly is not part of any design pattern that would make sense over the internet.  So if you can tell us a little more we might be able to give you some ideas about how to do what you want to do.
    LVL 16

    Author Comment

    I want to have full control over the headers my PHP application is sending.

    I cannot seem to remove the "Server" header no matter what I try.
    Server: Apache/2.2.8 (EL)

    I also don't like the way Apache interferes with my implementation of 304 headers.
    LVL 48

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to count occurrences of each item in an array.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now