Content Management and MIME Types

Want to serve your blog as xhtml 1.1 properly (application/xhtml+xml), but your page keeps showing as text/html?

I’m going to present a method to change this properly, and provide your site with the changes you want, while being transparent to browsers that don’t support the method.

I’m going to provide the instructions for modifying a kubrick-based template, but this code should be similar pretty much anywhere, just it’s location may change.

First, there should be some code appearing like this in your header.php file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type');
?>; charset=<?php bloginfo('charset'); ?>" />

Now, this tells the browser that your page is using the XHTML 1.0 Transitional, and it is using text/html, by default.

We, of course, want to use XHTML 1.1, because, well, we’re better than that :-D

I’m going to give you the code on the next page that you will be using.

Pages: 1 2 3

Leave a Reply