Forum Moderators: phranque
AddHandler application/x-httpd-php .css
With the above, in the htaccess, it does not gzip css files at all. With the following...
AddHandler x-httpd-php .css
...it does gzip, but the css doesn't work at all, and the page loads without style. So my first question is: what does the "application/" thing do? My second question is: why doesn't "AddHandler application/x-httpd-php .css
" work, when many people on the web say that it should? (I've tried addType as well, with the same results.)
<?php header('Content-Type: text/css'); ?> Be careful with caching, though, you may win out with file-size, but that does not help if you don't allow the generated file to be cached as the CSS file would be downloaded for every single pageview.
why doesn't "AddHandler application/x-httpd-php .css
" work, when many people on the web say that it should?
You'll need a handler which handles the request if the handler is set to application/x-httpd-php. mod_php's handler will handle the request, if the handler application/x-httpd-php was assigned. If you're using php via fastcgi etc. you'll have your own handler defined.
mod_php5 acts if the handler was set to application/x-httpd-php, application/x-httpd-php-source or php5-script.