W3C Validation: Conflict between Mime Type and Document Type [LÖST]

Här diskuteras programmering och utveckling
TicToc
Inlägg: 2266
Blev medlem: 27 dec 2006, 17:28
OS: Kubuntu
Utgåva: 20.04 Focal Fossa LTS

W3C Validation: Conflict between Mime Type and Document Type [LÖST]

Inlägg av TicToc »

Får följande resultat när jag kollar min sida:
http://validator.w3.org/check?uri=http% ... Flang%3Den
Important Warnings

The validator has found the following problem(s) prior to validation, which should be addressed in priority:

  1. Warning 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+xml

      Using 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 you are serving a static file on a Web server, changing its extension should help. Use e.g .xhtml for XHTML or .mathml for MathML.
          * You may need to reconfigure your Web server. This Setting up MIME Types tutorial has instructions for Apache, Tomcat and IIS.
          * 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.
Jag kan bara lite html, försumbart med php och just ingenting om apache webserver.
Kan någon säga mig vad som är bra att göra? I annat fall kan jag säkert läsa mig till det, men om du sitter inne med svaret så...

Till saken hör att detta verkar vara ett nytt "fel" på en sida som var fullt godkänd i våras.
Senast redigerad av 1 TicToc, redigerad totalt 12 gånger.
Lars
Inlägg: 6191
Blev medlem: 14 jan 2007, 19:31
OS: Ubuntu
Utgåva: 22.10 Kinetic Kudu
Ort: Stockholm

SV: W3C Validation: Conflict between Mime Type and Document Type

Inlägg av Lars »

Jag har inte så stor kunskap om PHP heller, men det kanske behövs en "header('Content-Type: application/xhtml+xml; charset=utf-8');"?
TicToc
Inlägg: 2266
Blev medlem: 27 dec 2006, 17:28
OS: Kubuntu
Utgåva: 20.04 Focal Fossa LTS

SV: W3C Validation: Conflict between Mime Type and Document Type

Inlägg av TicToc »

Fantastiskt! Stort tack. Ingen varning längre. Fick dock en liten biverkning, mina marginaler blev ofärgade, i stället för att få sidans färg, med det får jag snygga till i css'en antar jag.
Skriv svar

Återgå till "Programmering och webbdesign"