Tuesday, April 08, 2008

Apache2 mod_headers using to modify http response headers

将mod_headers.so复制到modules目录下,修改httpd.conf文件:

LoadModule headers_module modules/mod_headers.so
Header add P3P "CP=\"CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR\""
Header set TEST "%D %t"

其中Header可添加在Context: server config, virtual host, directory, .htaccess
Reference: http://httpd.apache.org/docs/1.3/mod/mod_headers.html
http://httpd.apache.org/docs/2.2/mod/mod_headers.html

No comments :