K
K
kk952019-04-29 12:41:06
Search Engine Optimization
kk95, 2019-04-29 12:41:06

How to redirect when switching to HTTPS?

Website changed from http to https. And a letter came from Yandex:

The main mirror of your website addressSite.ru has changed: instead of the addressSite.ru, the domain https://addressSite.ru has become the main one in the group of mirrors . We recommend checking that the new main mirror is available for indexing and gives the robot a 200 code.

If you are not satisfied with this choice, you can change the main mirror using a 301 redirect. Use the Site Move tool to speed up the application of the new directions and verify that the settings required for the change of address are correct.

Sites are recognized as mirrors of each other if they return the same content to the robot. If this is no longer the case, the sites will unstick automatically within a few weeks. For more information about mirror sites, see Help.

Questions arose: in which files and what to change, and where are the actual mirrors from (or even if they are not there, it still sends this Yandex message as a warning)? I read that it is not relevant to change the Host directive in robot.txt.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrew, 2019-04-29
@deepblack

Example config for nginx:

server {
    if ($host = your-site.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80 ;
    listen [::]:80 ;
    server_name your-site.com;
    return 404; # managed by Certbot
}

In this case, if the server name matches your-site.com (port 80)
, then it is redirected to port 443, of the same domain.
The response should be something like this:
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 29 Apr 2019 10:43:47 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: https://site.ru/about
X-XSS-Protection: 1; mode=block

Response code: HTTP/1.1 301 Moved Permanently
Redirects to:Location: https://site.ru/about

A
Alexander Denisov, 2019-04-29
@Grinvind

Don't panic, you don't need to change anything. Yandex really sent this as a warning.

P
Puma Thailand, 2019-04-29
@opium

you need to make a page redirect from http to https version

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question