|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Apache not sending mime-types
Hello
Well, in the beginning everything was almost in its default state: 1) apache was told to put .php files through php.exe by the ScriptAlias, Action, AddHandler directives 2) there was no mime-type specified for .php in httpd.conf 3)php was sending its default text/html. But then I had a crazy idea that I should have 2 types of php files - one that outputs text/html and the other that generates XHTML content and therefore outputs application/xhtml+xml. And that's where the problems began. I set the php.ini's default_mimetype to an empty string, so php stopped sending the content-type header. Then i added the following directive to the httpd.conf AddType application/xhtml+xml .xphp The problem is that I do not get any content-type header sent. I guess that Apache does not send content-type header in case when a handler was specified (i.e. expects the handler prog will send that header). Am I right? Or I just cannot see my mistake somewhere? I am running php 4.2.1 as CGI on Apache 1.3.22 on win2000 server. And just in case I guessed right, could anyone suggest a solution to this type of problem? Thanks in advance, Cyril |
|
#2
|
|||
|
|||
|
RE: Apache not sending mime-types
first, i suggest not running php as cgi, but as an apache module.
seccond, when apache forwards handling of some file to a cgi or module (like with php files), it doesn't send any content-type headers. you can send your own headers from php, like so: header('Content-Type: application/xhtml+xml'); one more note on smth you didn't ask about ;) IE can't handle this mime type (xhtml), so you should check if web browser accepts xhtml mime type, like so: have fun ;) |
|
#3
|
|||
|
|||
|
RE: Apache not sending mime-types
OK. So everything is exactly as I expected. Thanks a lot Zombie. =)
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Server Administration > Apache not sending mime-types |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|