I'm working on a website that has a number of style sheets all of which need to be handled as PHP scripts server-side. My .htaccess file looks something like this:
<FilesMatch "\.(css)$">
ForceType application/x-httpd-php
</FilesMatch>
This causes a small problem as the mime type of the http-response's Content-Type
field is then set to text/html
instead of text/css
.
Obviously I can fix this by adding header('Content-Type: text/css')
to all of my files but is there a better way?
Can I do this from within the .htaccess file? None of the directives offered by mod_mime or mod_negotiation seem to be what I'm looking for.
try:
php_value default_mimetype "text/css"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With