When your site is not responsive, but serves a mobile version instead of the desktop one, it is recommended to add a rel=”alternate” link to the head part of your desktop site notifying search crawlers about the existence of a mobile version for this page.
A simple way to do this in your template.php file:
1 2 3 4 |
//add alternate rel for google crawlers $nodecp=current_path(); $url="http://m.mysite.com/$nodecp"; drupal_add_html_head_link(array('rel' => 'alternate', 'media' => 'only screen and (max-width: 640px)' , 'href' => "$url")); |
The code above is simply to show how to add the rel=”alternate” link in Drupal and doesn’t take into consideration the logic of constructing the mobile url based on the desktop url which is very site specific.
*It is also recommended to add a canonical link from the mobile page to the desktop version