- Add rel="alternate" for the "Mobile View" link (in the footer) in the head of the desktop site.
- And vice versa, add rel="canonical" for the "Desktop" URL (in the footer) in the head of the mobile site.
For example, on http://en.wikipedia.org/wiki/Main_Page add <link rel="alternate" href="http://en.m.wikipedia.org/wiki/Main_Page">.
Developer notes
In T91183 such functionality was added by @Florian
Adding the following config
$wgMobileUrlTemplate = '%h0.m.%h1.%h2'; $wgMFNoindexPages = true;
will add a link tag to the document:
<link rel="alternate" media="only screen and (max-width: 720px)" href="">
Currently in production wgMFNoindexPages is false having been disabled by @MaxSem 5 years ago in Ia841ad77eacdf9b07222101f052e3c05f36dd02c. details there are slim (per discussion with google)