Fixit - MIME types
The MIME type is an internet standard which indicates the format of a message. The MIME type sent by a server provides important information to browsers on how to treat a document. This test determines if your page is being sent with the correct MIME types.
MIME types
Different types of document are sent with different MIME types. For example, some common file types, and their associated MIME types are listed below.
For XHTML Mobile Profile, and XHTML Basic, the recommended MIME type is application/xhtml+xml (under certain circumstances, application/vnd.wap.xhtml+xml and text/html are acceptable also, although they will generate a WARN in ready.mobi).
Set up your server to send correct MIME types
Using .htaccess
If you are using Apache, you can us a .htaccess file to associate file extensions with MIME types. Simply add this line to a file called .htaccess in the folder of the files you wish to send with the correct MIME types. This will cover all files in this folder and sub-folders. If there already exists a file named .htaccess, be careful not to any instructions already in this file as would modify the behaviour of your server. In this case just add the line below to the file:
# XHTML <br />AddType application/xhtml+xml .xhtml Using meta http-equiv tags
The meta http-equiv tag enables you to inform the HTTP server about the kinds of headers it may provide. If you do not have access to the server directly, but if you are able to modify your html pages then you can use a http-equiv meta tag directly in your content. Include the following line at the top of your page:
<meta http-equiv="Content-Type" value="application/xhtml+xml" />
Note, if the server sends a HTTP Content-type header, then any meta http-equiv="Content-type" tag may be ignored by the browser.
Using server side code
If you are using server side code to genereate your content then there is usually a method to set the server headers directly from within your server source code. Some examples are:
- Java Servlets: Include the line:
- JSP: include the line
- PHP: include the line
- ASP: include the line
response.ContentType = "application/xhtml+xml"
before any content is sent
response.setContentType("application/xhtml+xml");
before any content is sent
response.setContentType("application/xhtml+xml");
within scriptlet tags (i.e. <%....%>) before any other content.
ORinclude the JSP directive
<%@ page language="java" contentType="application/xhtml+xml" %>
at the top of the page, before any content
header("Content-Type: application/xhtml+xml");
before any other output line
Reference
This test is based on a W3C mobileOK best practice test. See http://www.w3.org/TR/mobile-bp/#CONTENT_FORMAT_SUPPORT for more details
Still confused? Get help at the forum.




Posted by Deygmh 2 years ago
I get a warning like this:
MIME type was detected as application/vnd.wap.xhtml+xml; charset=utf-8
I think this is valid. asp automaticly inserts the charset behind content type.
Regards,
Deygmh
Posted by QueyJoh 2 years ago
I get the same warning, can you clarify whether the ;charset=utf-8 will cause issues with handsets (we've seen none)? If it won't cause a problem, can you update the test to allow this?
Posted by ruadhan 2 years ago
I agree that the charset specified in the Content-Type header is perfectly valid. We'll look at this for the next release.
Thanks for the feedback!
Ruadhan O'DonoghuedotMobi
Posted by ruadhan 2 years ago
I've looked into this a little more deeply. The warning you are receiving is not because of the charset, but because you are not using the preferred content-type, which is application/xhtml+xml. (Warnings in ready.mobi do not affected your score)
Ruadhan O'DonoghuedotMobi
Posted by jimatwood 2 years ago
I am getting the following warning on my site after checking Mobi Ready.
"Incorrect or missing MIME types were detected"
I am currently running Wordpress 2.8+ and the dotMobi wordpress-mobile-pack.1.1.1 . Everything is running awesome and there appears to be no problems at all with this setup.
However, I'm sure everyone who runs these two options will definitely encounter this error if testing at MobiReady. It would be nice to have either a solution or a comment in some sort of FAQ informing people to disregard this error or something else. The "Fixit" section here telling us to modify the .htaccess or headers of the site does not work at all. Until someone complains about my site, I'll probably just let this go as I suspect everyone else is doing, but I thought I would post a comment just in case there is a solution right under my nose..LOL.
Thanks very much.
Regards,
http://ricochehost.comJim
Posted by ruadhan 2 years ago
Hi Jim, thanks for the feedback. This test will always report a warning if the MIME type sent by the server is text/html (which I suspect is what is being sent back in your case). A warning is sent in this case as it is not the preferred MIME type, although it is acceptable. (And of course mobileOK Basic tells us that we should flag a warning, rather than a full blown error)
Ruadhan O'DonoghuedotMobi
Posted by brenes 2 years ago
Hi there,
I'm trying to validate a mobile website - mobile.wiselayout.pt, but I keep on having an MIME error
FAIL near [0, 0]
MIME type for main document: text/vnd.wap.wml; charset=utf-8
Does anyone have an idea how to fix this.
Thank you very much.
Bruno