SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard johntabita's Avatar
    Join Date
    Mar 2001
    Location
    In a big, big house, with lotsa lotsa room
    Posts
    1,060
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Mobile website appearing in desktop search

    We've just began developing some mobile sites. It seems that at least one customer's mobile site appears in the desktop search results for his keyword phrase and location. In fact, the m.domain.com shows up just above his desktop URL in the Google SERP.

    These are not separate sites. We have a redirect code in place to direct mobile users to the mobile version of the site. I've never seen a m.domain in a desktop search ... until now.

    Is there some additional code I should be using to prevent this? Perhaps a 'disallow' in the robots.txt?

    Thanks!

  2. #2
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,836
    Mentioned
    114 Post(s)
    Tagged
    1 Thread(s)
    What you need to do is to tell Google that one page is a mobile version of the other. Don't block googlebot in robots.txt, because then it won't find the mobile site at all, so won't bring it up in mobile searches.

    Taken from http://developers.google.com/webmast...-sites/details

    On the desktop page, add:
    HTML Code:
    <link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.example.com/page-1">
    (or you can use media="handheld" although this isn't as reliable)

    and on the mobile page, add:
    HTML Code:
    <link rel="canonical" href="http://www.example.com/page-1">

  3. #3
    SitePoint Wizard johntabita's Avatar
    Join Date
    Mar 2001
    Location
    In a big, big house, with lotsa lotsa room
    Posts
    1,060
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Stevie,

    Thanks for the reply. However, I'm a bit confused about the mobile page vs. the desktop page. Since it's the same site, there's really only one page that's displayed differently for each type of user. What am I missing here?

  4. #4
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,836
    Mentioned
    114 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by johntabita View Post
    Thanks for the reply. However, I'm a bit confused about the mobile page vs. the desktop page. Since it's the same site, there's really only one page that's displayed differently for each type of user. What am I missing here?
    The pages have different URLs, therefore they are different pages – eg, the URL for the desktop page is www.example.com/page1 and the URL for the mobile page is m.example.com/page1. Where Google sees two different URLs, it assumes you have two different pages unless you tell it otherwise ... and the mobile page probably has a much higher content:noise ratio, faster download times etc, meaning that it thinks the mobile page is a better bet (there's a lesson in there somewhere). You may think it's the same page, it may even be created from the same entry in the database, but when it shows up with a different URL, it's a different page.

    That's why you put the alternate link on the 'real' page, to flag up that the other page is just the mobile version of it, and the canonical link on the 'mobile' page, to direct search bots back to the main page for non-mobile users.

  5. #5
    SitePoint Wizard johntabita's Avatar
    Join Date
    Mar 2001
    Location
    In a big, big house, with lotsa lotsa room
    Posts
    1,060
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    I assume I must do this for every page, not just the index page? Again, thanks for your help.

  6. #6
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,836
    Mentioned
    114 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by johntabita View Post
    I assume I must do this for every page, not just the index page? Again, thanks for your help.
    Yes, every page that appears in both the desktop and mobile versions of the site needs this treatment. If you're using any sort of decent CMS or PHP template then you should be able to get those lines added automatically.


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
  •