Vull I have not used Apache in a long time so I don't recall the proper way to set that.
The best way to test your HTML/XHTML is using the
W3C validator.
You can see what your server is actually delivering by using the dev tools in Firefox. Enter ctl-shift-C and click on Network. That should display the files being served. Click on the html one. Click on Headers on the right side and look for "content-type". If you are serving HTML, then it will list it as "text/html". If it truly is XHTML, it should say "application/xhtml+xml".
A little more follow up here, just in case anyone else reading this in the future might be interested in serving pages as xhtml: PHP allowed me to serve my pages as application/xhtml+xml by using the PHP header() function to send an additional header prior to sending the actual document or page:
PHP:
header ("Content-type: application/xhtml+xml;charset=UTF-8");
... this requires PHP but should work with any webserver software. However, doing this made my ECMAScript (javascript) unusable, most likely because, as I now understand it, I'm partly or entirely using the XML DOM (document object model) instead of the HTML DOM. To serve my page as xhtml, I also needed to change my opening HTML tag:
HTML:
<html xmlns="http://www.w3.org/1999/xhtml">
... I also shortened my META tag from
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
to
<meta charset="UTF-8" />
which I don't think is absolutely necessary but it's less confusing from my POV.
Once having accomplished this, I decided to revert back to serving my pages as text/html, and would like to say why. One reason is that I simply don't want to re-debug my scripts to work with with the XML DOM; it's probably quite do-able, I just don't want to take the time to do it. Since this is only a personal project, I have the ability to easily opt-out of anything I don't want to do, as well as the luxury of deciding not to support any browsers other than the ones I choose. Active professional programmers usually don't have such luxuries, and may decide to use xhtml or xhtml5 for these reasons as well as other reasons.
Another important reason for opting-out is that further research into this area (after 10 years of basically ignoring it) suggests that the popularity/market share of XHTML has declined over the past 10 years, and is now at around 14%, and steadily declining, as indicated
here, as opposed to HTML5 which is reportedly over 86% of market share and growing, as suggested in that same link, and also indicated
here.
I read this as meaning that plain text HTML5 is more likely to be around in the future (like another 10 years), and a little more research has suggested that HTML5 is probably going to be more stable for other reasons. Using PHP's xml_parse() function allows me to check my syntax, which was my main reason for migrating towards XHTML in the first place, and to do the syntax-checking server-side, where I can control it, as opposed to relying on the browser to do it for me. Furthermore, even if I debug my ECMAScripts to work with the XML DOM, serving pages as application/xhtml+xml will actually
break the syntax-checking mechanism I already have in place, because the browser would then be unable to display the screenshot I showed in my previous post-- the syntax is already broken in the page as displayed, and so the browser using the xml parser would decline to, or be unable to, display it.