I am developing a mobile version of the store site and faced such a problem. There is site.com and its mobile version on another domain m.site.com (physically exact copy of the site in another directory with other html markup templates, respectively). Redirection from the main version to the mobile version is done in php. On the mobile version, just link to the full. Now the actual problem, when searching from a regular desktop browser, links to Google lead respectively to the regular version (http://site.com/catalog/488). And when searching from a mobile for the same google, they give out links like http: // m .site.com / catalog / 488 (which is generally logical). So the task is this - to make it so that when searching from a smartphone in the results it was the link to the main site that was displayed. As an example, I can give such a request from an Android smartphone to Google. I enter into the search for "baby clothes" One of the results of the site "www.gymboree.com" is exactly how the link appears. Well, during the transition there is a redirect to the mobile version. At the same time, it is also possible to switch to the regular version from the mobile. Those. The redirect was not performed using the .htaccess HTTP_USER_AGENT definition. Now, if briefly, how to achieve that when displaying the results from Google’s mobile, a link to the main site and not to the mobile version was displayed?

    1 answer 1

    Use robots.txt , with site mirrors it is recommended to use the "Host" directive.

    • This makes sense, read in more detail, set, waiting for the results, when Google revisits. If a ride, I will note the right one. - DimKabuki
    • While something is not working. It seems like Google re-indexed the pages, but the letter m did not go away. I’ll remind you of the problem, when searching from a mobile in Google’s results, it gives a link to the mobile version of m.site.com, and it’s necessary that in a mobile search be just site.com. In the robots.txt in the mobile version, the Host directive is indicated www.site.com as and in the main site robots. - DimKabuki
    • Is the problem still relevant? If so, try to register in htaccess using the mod_rewrite redirect section (301) to the domain you need. sb-money.ru/article.php?a=75 - Ravel