Six Apart
Mobile Link Discovery spec
This page describes a rough specification for Mobile Link Discovery, a lightweight XHTML/RSS/Atom link relationship to describe mobile version URLs of any page.
Summary
Any webpage that also has a mobile optimized version (Publishers) should have the mobile URL specified in its link tag, like:
<link rel="alternate" media="handheld" href="..." />
so that external websites like search engines, weblogs, and/or social bookmarking sites (Consumers) can link to its mobile version from their mobile version, instead of linking to PC versions.
You can specify Mobile Link in RSS or Atom feeds as well.
Examples
In XHTML of http://yoursite.example.com/, you just put:
<link rel="alternate" media="handheld" type="application/xhtml+xml" href="http://yoursite.example.com/mobile" />
This means http://yoursite.example.com/mobile serves XHTML content version of http://yoursite.example.com/, optimized for mobile browsers.
Background
These days a lot of web sites have mobile optimized webpages and usually publishers use different URLs for them. For example, Google has its mobile version of homepage at http://www.google.com/xhtml (instead of http://www.google.com/).
Usually publishers (Google in this case) uses techniques to dispatch mobile devices to its mobile version by looking up User-Agent string. This works fine when you make mobile webpage that only links to web pages under your control.
However, this might cause a problem linking to external sites from mobile optimized web pages. We can't make sure the target URL has mobile optimized page or not. Mobile Link Discovery tag solves this problem.
Publishers will just put a link to its mobile version URL in XHTML and optionally in RSS and/or Atom feeds, so that Consumers like search engines, social bookmarking and any mobile websites that link to external sites can link to mobile version appropriately.
Protocols
XHTML
<link rel="alternate" media="handheld" type="text/html" href="{mobile URL}" />
This is not anything new. The usage of @media attribute is defined in the HTML4 spec.
Atom 1.0
<link rel="alternate" x:media="handheld" type="text/html" href="{mobile URL}" />
You can put the <link> element under <feed> and/or <entry>, both of which are optional. We're working on determining the Namespace URI for x:media right now, as of this writing.
RSS
<rss xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xhtml:link rel="alternate" media="handheld" type="text/html" href="{mobile URL}" />
You can put <xhtml:link> element under <channel> and/or <item>, both of which are optional.
What You Can Do With This
Content Publishers
If you have a weblog, or you have a blog service that hosts thousands of users' blogs, and you have mobile optimized URL for them, put the Mobile Link Discovery on your XHTML/RSS/Atom feed so that your sites can be linked from mobile sites appropriately.
Content/Feed Consumers
If you have a mobile search engine, social bookmarking sites, feed aggregator or whatever mobile pages that might have a link to external sites, you can get mobile link URL by looking up Mobile Link Discovery and if any URL found, you can link to mobile version appropriately from mobile optimized pages.
The recommended/suggested easy way to put a link to external sites will be to rewrite every link so it uses redirector:
<a href="http://www.example.com/">foo</a>
will become:
<a href="http://yoursite.exapmle.com/redir?url=http%3A%2F%2Fwww.example.com%2F">foo</a>
and the URL /redir does the following:
- issue a GET request to the url (http://www.example.com/)
- Try finding Mobile Link Discovery tag (
<link rel="alternate" media="handheld" ... />) in the (X)HTML - If Mobile URL found, redirect to the URL
- Otherwise, just redirect to the original URL (http://www.example.com/)
Author
- Tatsuhiko Miyagawa (VP of Partner Engineering, Six Apart)
License
This work is licensed under the terms of the Attribution/Share Alike Creative Commons license.
Supporters
Here's a list of people who I talked with about this protocol, and agreed to make it standard.
- Gen Kanai (Technorati Japan)
- Tantek Çelik (Technorati)
- Byrne Reese (Six Apart, Ltd.)
- Eric Lunt (FeedBurner)
- Naoya Ito (Hatena)
- Tomohiro Ikebe (Livedoor)
Sites using Mobile Link Discovery
Here's a list of Publisher/Consumer that supports Mobile Link Discovery.
- TypePad Japan
- Hatena Diary
- Livedoor Blog