I have been testing my project using the W3C Validation tool and it passes 100% with no errors and just 1 warning - XHTML 1.0 Transitional.

Warning - Conflict between Mime Type and Document Type

After some research I can find tons of definitions of the various MIME types, so the correct one for my project is 'application/xhtml+xml'.

But, where does it go - is it part of the DTD?

What other code do I need as this doesn't look complete on it's own?

  • 2
    Are you sure you actually want to do this? Unless you know exactly what you're doing–in which case you'd probably already know how to take care of it–you're potentially opening yourself up to a lot of problems, only starting with browser compatibility. Then Javascript. Then well-formedness as an absolute requirement. And so on. Otherwise, as @DKOATED says. – Su' Apr 25 '13 at 10:08
  • It was the idea of having a W3C valid website, but you could be right as it's new territory for me and probably not worth the potential issues. Thanks – Ubique Apr 25 '13 at 12:28

Usually you set mime-types for different types of "files" which are passed from your server to the receiver.

In Apache you would add the following lines to your .htaccess file (in your root directory):

AddType application/xhtml+xml .xhtml .xht

You'd add the file's extension to whatever you'd want to transfer with that mimetype. Be it .xhtml, .xht, .html, .php or whatever.

See Configuring MIME Types in .htaccess and Mod MIME under AddType Directive

  • Thanks for the explanation, I'm not comfortable with the server side and was thinking it was a simple page markup issue. Thanks for answering :-) – Ubique Apr 25 '13 at 12:29
  • no problem. glad to be of help... – David K. Apr 25 '13 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.