Forum Moderators: coopster
Does anyone know if it is possible through the .htaccess file to make the server treat the .css files like .php files, while at the same time, maintaining the .css expectations of the visitors browsers?
I was thinking of the benefits of being able to use the dynamic benefits of PHP integrated with the layout power of an external CSS document.
AddType application/x-httpd-php .css You should then be ok to use the css files as normal in the <link> tag, however if you are having prolems then add the following function into your css files to set the content type:
header('Content-type: text/css'); However adding the line to your .htaccess will mean that all of your css files will be parsed as php, whether dynamic or not, and so may slow down page load.
Chris
I only have one external CSS document for the site, the rest of them being processed is a moot point, at least for me. However, you have me worried, when you talk about slowing it down. Would you know if this a negligible amount of time, or if it would be noticeable?
Thanks again.
Chris