header(\"Content-type: text/css\");
works in Firefox, Chrome and other, but not in Internet Explorer 9. I am not sure what\'s up.
In Chrome an
Is there any output before the header is sent? BOM in the php file? A carriage return?
If you disabled error reporting, you may not see the error it should trigger.
Try adding ob_start()
on top, it will resolve any issue related to headers already sent before any header()
call.
If you have a BOM in your UTF8 file, you may want to remove it.
For Internet Explorer 9 serving HTTP 406 status code in the response header for a dynamically generated CSS file we:
Added a rewrite rule to the virtual host configuration or htaccess:
<IfModule mod_rewrite.c
RewriteEngine on
RewriteBase /
#serve CSS and JS from combine.php
RewriteRule ^combine(.*) combine.php [NC,L]
</IfModule>
Note: This solution is only good for servers/virtual-hosts not using Multiviews as removing mod_negotiation removes usage of this directive as well.