xhtml 1.1 MIME type solution
Inspired by a recent posting on diveintomark, I redoubled my efforts to make this site use XHTML 1.1 properly, even including serving it as application/xhtml+xml
, which makes content unreachable by IE.
When querried, Mark said he was using Apache’s mod_rewrite module to munge the content-type field based on the UA string (mozilla), by adding this text to his .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} Gecko
RewriteRule \.html$ – [T=application/xhtml+xml; charset=utf-8,PT]
I dug a little deeper, and found this technique on a German-language site. It changes the content type if the UA claims support for application/xhtml+xml
.
RewriteEngine on
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0
RewriteCond %{REQUEST_URI} \.html$
RewriteCond %{THE_REQUEST} HTTP/1\.1
RewriteRule .* – "[T=application/xhtml+xml; charset=utf-8]"