SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    May 2010
    Posts
    229
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    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!

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,893
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by sixrfan View Post
    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?
    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>:
    HTML Code:
    <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.

  3. #3
    SitePoint Addict
    Join Date
    May 2010
    Posts
    229
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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?

  4. #4
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,893
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by sixrfan View Post
    why wouldnt the href portion be written as
    Code:
    href="m.mywebsite.com"
    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 http:// 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.

  5. #5
    SitePoint Addict
    Join Date
    May 2010
    Posts
    229
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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:

    Code:
    <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?

  6. #6
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,893
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by sixrfan View Post
    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:

    Code:
    <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 http://m.domain.com/ for the link to work.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •