How do I set the correct Content-Type header for the different browsers?

Associate
Joined
10 Jul 2006
Posts
2,423
I'm running an Apache server to host my websites. They are all written in XHTML5 so I WANT to serve them as application/xhtml+xml.

The default on Apache is to serve pages as text/html.

Is there a configuration that I can put at the bottom on my config file that will set the response header Content-Type to application/xhtml+xml for the browsers that support it, otherwise serve as text/html (for < IE9 basically.)

For the pages that are PHP too, do I have to do anything different/ontop of this?
 
I was under the DISTINCT impression that there is a difference between HTML5 and XHTML5....and I am still 99.9999999999999% sure there is to be honest.

To give an example, this is OK is HTML5:

Code:
<meta name="author" content="me">

but in XHTML5 you must close it (its more strict):

Code:
<meta name="author" content="me" />

Whether you serve as text/html or application/xhtml+xml will change how the browser builds the parse tree to your website....as far as I know.


EDIT:

http://html5doctor.com/html-5-xml-xhtml-5/
 
Last edited:
Back
Top Bottom