Is it possible to save a static html file with built in http headers ? So that putting it on any server will work including the http headers?

If so how?

  • Why on Earth would you want to do that?
    – Chris S
    Commented Oct 10, 2011 at 12:39
  • need to call a page from an iframe on another domain and get user cookie which is on the site domain of my customers. So I want to drop a file in their domain which will read the cookie and redirect. The problem is IE doesnt allow cookies in iframe without p3p privacy policy. I want to add the policy to this file and still be able to drop it on any server and have this work.
    – Niro
    Commented Oct 10, 2011 at 13:54
  • 2
    @Niro: Any server? Sorry, no can do. The server landscape is, let's say, somewhat diverse: Apache, IIS, nginx, what-have-you. There is no Silver Bullet (TM) which would automagically Make It Work (TM) on any server; this isn't a Hollywood movie. Commented Oct 10, 2011 at 14:32

4 Answers 4


For Apache, there is the module mod_asis, which does just that - reads the file and sends it on its merry way as a complete HTTP response.

This module is shipped with Apache by default, but you need to enable it first (see the docs, there's a reasonable example).

  • Nice! Forgot about this!
    – mahnsc
    Commented Oct 10, 2011 at 12:59
  • Cant have it activated. I need to drop a file on their http root and thats it
    – Niro
    Commented Oct 10, 2011 at 13:49
  • 6
    @Niro: So, are you saying "the server should read my mind and do what I mean, can't be so hard"? The answer to that will be rather disappointing, I'm afraid. Commented Oct 10, 2011 at 14:34

I won't go so far as to say it is impossible but I would assume then that whatever reads that file prior to serving it would need to parse that file prior to delivery. This would then make this static html page more like an active server page, cold fusion markup, or java server page and no longer static html.


I don't know of any webserver that will allow you to do this natively. There may be extensions available for some of the more popular software packages, but I don't know of any. What you are asking for is highly irregular.

That said, almost all web server software supports CGI, in which the script being called is expected to supply the relevant headers for the request. Therefor writing a short script that simply ready your "static file" in and returns it to the client should work. Depending on your application this could be anywhere from trivial to extremely complicated.


Looks like its possible to add an http-equiv header. Not sure it works.

<meta http-equiv="P3P"  content='CP="HONK"'>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .