Apache parsing css files for php scripting.
Hey folks,
I have a few pages setup where I need to run php scripts inside my css files. But only a few... So for apache.conf I have added that it should parse css files as php, and for the css files with php in them, I have added the header accordingly. Now that's great for the few sites that need this, but the changes in apache.conf are system wide, so now ALL css files need that header added to them.... there's a lot of css files! For the few pages that need CSS, can I just do a <link rel="stylesheet" href="styles.php" /> rather than styles.css? That way I can remove the parsing of css files from apache.conf.... Or how would I restrict the apache.conf file to only apply the css settings to certain folders? |
Hi
If you use virtual hosting with Apache, you can just add a Code:
AddType application/x-httpd-php .css Another way is to turn it off completely, and instead of refering to the .css files, put it inline in the page. So instead of using Code:
<link rel="stylesheet" href="cssfile.css"> Code:
<style type="text/css"> Using PHP - it can be like: Code:
echo "<style type=\"text/css\">\n"; |
All times are GMT -5. The time now is 04:27 PM. |