Hi all,
I would like to configure apache php5 in a way that
- .css and .js files will be inspected by php
- their content type will remain as default (that is respectively "text/css" and "application/x-javascript")
I need this because both CSS and JS files are using global PHP vars. This allows me from a single PHP file to control both CSS and JS code dynamically (then the project is exported so that css and js files contain the actual values and not the PHP echos).
The way I'm doing right now is that I added .css and .js extension to apache php5.conf:
AddType application/x-httpd-php .php .phtml .php3 .css .js
I also use header('Content-Type: [...]') on top of each css/js file to change the Content-Type header value back to original. This isn't ideal as I have to manually add this line to every css/js file in order for the Content-type header to be appropriate, even if I do not use the PHP global vars.
So anyway I can make PHP inspect css/js files while keeping their original Content-Type without having to modify the actual css/js files themselves?