Forum Moderators: coopster & phranque

Message Too Old, No Replies

Adding headers to apache without going nph and without conf access

         

Brett_Tabke

5:57 am on Sep 11, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



How can I add headers without going nph and without access to the conf file?
I'd like to add p3p headers to all my sites but I don't see a way to do it without access to the config file and without going full unparsed headers on everything.

sugarkane

9:44 am on Sep 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if the sites are dynamic already, and you're adding headers rather than modifying the default server ones, couldn't you just add it before the script's output eg

(in perl)
print 'P3P: policyref="/w3c/p3p.xml"\n';
print "content-type: text/html\n\n";

(in PHP)
<? header('P3P: policyref="/w3c/p3p.xml"');?>

I've not tested this, but seems like it should work?

bird

8:36 pm on Sep 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For (more or less) static header additions:

[httpd.apache.org...]

If you can place files into the directory where your HTML files are, put a .htaccess file there containing a line similar to this:

Header set P3P "policyref=\"/w3c/p3p.xml\""

This obviously assumes that mod_headers is available, and you may have to fiddle with the quotes until it really does what you need. It will have effect on the local directory, as well as all of its subdirectories where you don't specify something else.