serving xhtml + mathml to firefox and IE
Question
Firefox requires xhtml extension for mathml but IE will not display pages with xhtml extension (it displays a download dialog box instead).
I have tried apache content negotiation like so:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} .*MSIE.*
RewriteRule \.xhtml$ - [T=text/html]
but IE seems only to care about the extension. I have tried this on my local server where mod_rewrite is installed.
Solution
It seems that this works:
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} !.*MSIE.*
RewriteRule \.html$ - [T=application/xhtml+xml]
RewriteCond %{HTTP_USER_AGENT} .*MSIE.*
RewriteRule \.html$ - [T=text/html]
</ifmodule>
If it weren't for internet explorer, I'd know so much less about all sorts of things!
OTHER TIPS
Internet Explorer doesn't support XHTML (except marketing XHTML) or MathML (without a plugin).
If you want to use MathML — forget about unadulterated IE support for your pages.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow