Serving XHTML5 to Internet Explorer
I'm a big fan of XHTML - aka XML Serialised HTML. It's far more strict than HTML, which forces good code. Not only that, it's easy to parse with standard XML parsers and you don't need to handle sloppy HTML.
HTML5 is the new kid on the block with a host of new features (like um...?). You can also use XHTML5 to keep things tight and proper like.
Assuming you've written your HTML properly and dealt with non-closing tags correctly then there is little difference between HTML5 and XHTML5 - it's just how you serve it up.
HTML5 should have a DocType define like this:
<!doctype html>
And XHTML:
<!DOCTYPE html>
All nice and simple so far. The other main difference is the Content-Type - this is not something that is done in your mark-up, but by the HTTP server. XHTML5 needs to be served up as application/xhtml+xml, whilst normal HTML comes as text/html.
If you name your document .xhtml some HTTP daemons will automatically do this for you.
There is though, a snag. And this snag is what causes many people to recommend not using XHTML and to instead, using the lapse world of HTML. The snag is Internet Explorer 8 and below bails when it receives a content-type of application/xhtml+xml. Despite IE claiming to handle every content-type with a Accept: */* header, it can't.
Still, with Apache, there is an easy fix for IE with your .htaccess and utilising the BrowserMatch and Header directives:
BrowserMatch "MSIE [1-9]." oldbrowser Header set Content-Type text/html env=oldbrowser
This simply does a regular expression match against the user-agent, by specifying the . after the major-version number means it won't go wrong with IE 10.0. And if that matches the environment variable oldbrowser is created (this is one we've just made up).
The second line sets the Content-Type response header, but only if the environment variable oldbrowser exists. Note, that if you set your Content-Type in PHP or something Apache won't change it.