Anne van Kesteren

Howto use .xhtml properly and stay compatible with Internet Explorer

Internet Explorer often won’t show pages using the .xhtml extension and offers users a download dialog instead. Since .xhtml extensions are essential to mobile phones I went looking for a solution. You should add the following to either your httpd.conf or .htaccess (if you don’t have access to the former) file:

AddType text/html .xhtml
DirectoryIndex index.xhtml

Isn’t it great? Many thanks to the guys over at the dev.mobi forum for breaking the web.