Z
Z
Zimaell2020-02-10 12:41:34
Search Engine Optimization
Zimaell, 2020-02-10 12:41:34

How to redirect to the mobile version correctly?

How to redirect to the mobile version of the site?
At the moment, I do this - I determine that this is a mobile device or a PC, then I call the necessary part of the script, that is, require_once('/index.php'); or require_once('/index_mob.php'); , while the sitemap remains the same ...
Or do you need to do something differently, a separate subdomain, a separate sitemap ... ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
granty, 2020-02-11
@Zimaell

There are 3 ways to make your site mobile friendly :
1. Responsive design
2. Dynamic display
3. Different URLs
The first two don't require redirecting to the mobile version. The third is demanding.
Which method of the three is better - the topic is hollivar, so I will limit myself to links to Habr:
Comparison of methods for creating mobile versions of sites
Should I make a mobile version? 5 common pro...
And on the recommendations of search engines on how to make mobile versions of the site and the correct redirection to the mobile version:
Yandex indexing the mobile version of the site on ...
Sites for mobile devices, Yandex
recommendations Google recommendations if the mobile/desktop version...
In short, Google recommends using tags for the 3rd method:

On the desktop page (http://www.example.com/page-1), add the following code:
<link rel="alternate" media="only screen and (max-width: 640px)"
 href="http://m.example.com/page-1">

On the mobile page (http:// m.example.com/page-1), the annotation should look like this:
<link rel="canonical" href="http://www.example.com/page-1">

Yandex recognizes the mobile version on a subdomain, but does not recognize it in a separate folder:
If the mobile version of the site is located in the directory of the main site, the Yandex indexing robot will not be able to correctly index the data and recognize the site as mobile-friendly. Use responsive design or dynamic layout

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question