Search code examples
apache.htaccessp3pmod-headers

Setting P3P headers in Apache causes Internal Server Error


I wanted to set the P3P Headers by adding them to .htaccess using the following:

<IfModule mod_headers.c>
Header set P3P "CP="ALL DSP COR CUR ADM TAI OUR IND COM NAV INT""
</IfModule>

However, this causes an Internal Server Error. The only related entry in the server log I can find is .htaccess : Header has too many arguments

As far as I can tell, mod_headers.c loaded.

Any idea on how to fix this? Thanks!


Solution

  • This line:

    Header set P3P "CP="ALL DSP COR CUR ADM TAI OUR IND COM NAV INT""
    

    Should be written as:

    Header set P3P "CP=\"ALL DSP COR CUR ADM TAI OUR IND COM NAV INT\""