I want to add several headers to all PHP output on my server. In a perfect world, I could just use Apache2s’ mod_headers, but unfortunately I’m using WordPress “pretty permalinks”, so my PHP files do not end in .php, thus I cannot use the FilesMatch directive. Changing the permalinks to include .php is not an option.
So is it possible to modify all PHP output (server-wide) in some other way?
I would even be content to apply my custom headers to all text/html, but I don’t think there is a way to target output by MIME-type with Apache2.
(NOTE: If we can figure this out and the solution is server-related, I’ll move this question over to ServerFault.)
You could try setting the auto_prepend_file in your php.ini to include a php file in which you could then set the headers using the header() function.