Posted by:
c2dan
(---.15-1.cable.virginmedia.com)
RalphEs Wrote:
-------------------------------------------------------
>
> as soon as I parse .css in apache with
>
> AddType application/x-httpd-php .css
>
> the mime type in the header are changing.
>
With that you're now telling Apache to send all requests for .css files to the PHP Interpreter. BY default the PHP Interpreter sends back the text/html content type header, even if you've not placed any PHP code within the .css file.
To override the defailt content type sent back by PHP you you must explicitly tell PHP to send back a different content type, using the header() function as I suggested in my earlier post.
header( "Content-type: text/css" ) ;
If you didn't add this line in to the httpd.conf
AddType application/x-httpd-php .css
The all .css files will send back the text/css content type header. All web browsers expects the text/css content type header to be returned when parsing .css files. If it see's the content type as text/html it will parse the file as HTML not CSS.
Edited 2 time(s). Last edit at 08/24/2009 07:34PM by c2dan.