Need help with Apache, MultiViews, PHP, and the Content-Type header

I’m finally getting into PHP, and have it set up on my computer, but I’m having a problem with Content-Type. Without PHP, if I do, say,

AddType application/xhtml+xml pxhtml
AddType text/html phtml

I’ll get .phtml files served as html and .pxhtml files served as xml. But when I tell it to route them through PHP (with AddHandler php5-script phtml pxhtml), PHP undoes that and rewrites it with its own, always as text/html.

I found the default_mimetype setting in php.ini, but it’s not helping. If I set it to something, all files are served that way, so I can’t distinguish between html and xhtml. If I don’t set it at all, it falls back to the default of text/html. And if I set it to the empty string, it still sets everything to text/html, probably meaning it’s just falling back on the default.

So how can I make it respect MultiViews’ setting?

Comments are closed.