.mobi page template

24 December 2007

I've recently bought some .mobi domain names and wanted to get things right, mark-up wise. Here's what I've settled on and the problems it causes.

First I change(or is it add?) the content-type response header, application/xhtml+xml;charset=utf-8. In this case with ColdFusion:

<cfheader name="content-type" value="application/xhtml+xml;charset=utf-8">

Then I add the following DOCTYPE and html name space.

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">  <html xmlns="http://www.w3.org/1999/xhtml">  <head>   <title>Page title</title>  </head>  <body>    <h1>Page title</h1>    <p>Paragraph</p>    </body>  </html>

This seems to work quite nicely except when I go to view the page in IE7 and I get prompted to download the file. I'll look into that another time.

Another thing to take into consideration is caching. With this is mind I use the following:

<cfheader name="expires" value="#GetHTTPTimeString(DateAdd('d', 1, Now()))#">

This is a nice tool to check your .mobi pages for problems. Then of course there's the validator we all use and how one of my .mobi sites turns out.