Why does google want link to mobile site on desktop site

in this article the author says that…

“When using alternative URLs for mobile, Google would like… use of the link alternate tag on desktop pages pointing to the mobile version of the URL.”

if i understand correctly, they’re saying that i should put a link on my desktop site to the mobile site. is that correct? if so, why would they want that? if its not correct, what are they trying to say that i’m not understanding?

please advise. thanks in advance!

[font=verdana]What Google wants is to be able to send mobile users to the mobile version of a page, and be sure that it’s sending them to the right place.

It isn’t saying you need to have a visible link from a desktop page to the mobile equivalent (although that won’t hurt, because there will be plenty of mobile users who will hit onto the desktop page and might want to switch), but it’s about having a link like this in the <head>:

<link rel="alternate" media="handheld" href="/m/this-page.htm">

where the href gives the URL of the mobile version of the page. That way, it can be sure that it has matched up pages from the mobile site with their equivalent pages on the desktop site correctly.[/font]

why wouldnt the href portion be written as

href=“m.mywebsite.com

?

also, how would i get that code to be page specific without having to type a different link of code into the head of every single page?

[font=verdana]It depends on the setup of your site. You might have domain.com/m/page.htm or m.domain.com/page.htm – both are common ways of denoting a mobile version. But if you using the second format, you would need to include [noparse]http://[/noparse] in the href.

also, how would i get that code to be page specific without having to type a different link of code into the head of every single page?

If you’re using PHP or some form of CMS system, and there is a simple pattern to the URL format (eg changing domain.com to m.domain.com) then you can write a script that will automatically insert the relevant URL in there. If you’re writing each page separately then it’s just a bit of slog.[/font]

thanks.

so my site is setup to use the m cname so m.domain.com/page.htm.

i’m using wordpress as my cms so it sounds to me like i should do something like this in the header.php file:


<link rel="alternate" media="handheld" href="m.domain.com/<?php some php code that says what the subpage url is ?>">

does that sound about right?

Pretty much, except that as I said you will need [B]http://[/B]m.domain.com/ for the link to work.