Quando tento la validazione col validatore W3C mi viene segnalato questo potenziale problema:
Conflict between Mime Type and Document Type
The document is being served with the text/html Mime Type which is not a registered media type for the XHTML 1.1 Document Type. The recommended media type for this document is: application/xhtml+xmlUsing a wrong media type for a certain document type may confuse the validator and other user agents with respect to the nature of the document, and you may get some erroneous validation errors. How to fix this problem? One of the following techniques should help:
- If the document is generated dynamically, the scripting language should allow you to set up the mime type: this article on MIME Types and Content Negotiation has examples in PHP, Perl, and ASP.
e poi mi si manda su Juicy per la soluzione. Juicy mi dice:
header function. The $_SERVER array contains the server variables, allowing us to interrogate the Accept HTTP header. header("Vary: Accept");
if (stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml"))
header("Content-Type: application/xhtml+xml; charset=utf-8");
else
header("Content-Type: text/html; charset=utf-8");
Io, però non sono capace di trovare il file php dove fare il cambiamento. Cosa ne pensate? Conviene? e dove farlo se conviene?






