mod_fcgid setting content-type header
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Hi,
I am running PHP through mod_fgcid using the following setup in a conf file:
<IfModule !mod_php4.c>
<IfModule !mod_php4_filter.c>
<IfModule !mod_php5.c>
<IfModule !mod_php5_filter.c>
<IfModule !mod_php5_hooks.c>
<IfModule mod_actions.c>
<IfModule mod_alias.c>
<IfModule mod_mime.c>
<IfModule mod_fcgid.c>
<IfModule mod_headers.c>
DefaultInitEnv PHPRC=/etc/php5/cgi
#DefaultInitEnv PHP_FCGI_MAX_REQUESTS 5000
AddHandler php-fcgi .php .css
Action php-fcgi /fcgi-bin/php-fcgi-wrapper
AddType application/x-httpd-php .php .css
<FilesMatch "\.css$">
Header set Content-type "text/css"
</FilesMatch>
Alias /fcgi-bin/ /var/www/fcgi-bin.d/php5-default/
<Location /fcgi-bin/>
SetHandler fcgid-script
Options +ExecCGI
Order Allow,Deny
Allow from All
</Location>
</IfModule>
</IfModule>
</IfModule>
</IfModule>
</IfModule>
</IfModule>
</IfModule>
</IfModule>
</IfModule>
</IfModule>
As you can see, in addition to parsing .php files as PHP, I am also parsing .css files as PHP. This is indeed working, however the Content-type is not being set correctly in the response headers from my server. The Content-type for .css files is still text/html. I added the <FilesMatch "\.css$"> directive to try to set the Content-type, but that is not working. I'm guessing that the fact that I'm using mod_fcgid has something to do with this, as the mod_fcgid processing is probably rewriting the Content-type to text/html after I set it to text/css? I've tried several different permutations including the ForceType directive, but I just can't get the Content-type set correctly. The only approach I've found that works is to stick a header("Content-type: text/css") at the top of my css files, which is inconvenient to say the least. Anyone have a solution for this?
Thanks,
Ross
[Index of Archives]
[Open SSH Users]
[Linux ACPI]
[Linux Kernel]
[Linux Laptop]
[Kernel Newbies]
[Security]
[Netfilter]
[Bugtraq]
[Squid]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Samba]
[Video 4 Linux]
[Device Mapper]