I've got my .htaccess file set to the following:
Header set MyHeader "I'm Set!"
If I go to that directory (
http://example.com/test/), which has no default index file, and view the network activity (in this case with Chrome), I can see that the header is being sent. If I go to a php file (
http://example.com/test/test.php), the header isn't sent.
I've created an index.html (with simply
<pre>Hi as the content) and it gets sent. I change the file name to
.php, no header. If I change the orignal
test.html, it outputs the garbage-looking code, and the header is sent. If I change
test.png, I get a broken image icon, and the header is sent.
So, without testing beyond the above in terms of mime-type and file extensions, it appears only
.php files (legit or otherwise) are either set to not have .htaccess rules apply or specifically the mod_headers directives. But I don't know how to test for this and because it's a shared server, I don't have
httpd.conf access to poke around.
Any ideas as to why apache would skip sending headers for php files?
I've also tried:
<FilesMatch "\.(php)$"> Header set MyHeader "I'm Set!" </FilesMatch>