I can’t find the right solution.
Yandex says that the robots.txt file should be excluded from the HTTP redirect on HTTPS.
I can not find a ready-made solution.
web.config file:
& lt; configuration & gt;
& lt; System.WebServer & GT;
& lt; rewrite & gt;
& lt; rules & gt;
& lt; rule name = "redirect to https" stopprocessing = "True" & gt;
& lt; match url = "(. *)" / & gt;
& lt; Conditions & gt;
& lt; add input = "{https}" pattern = "off" ignorecase = "true" / & gt;
& lt; / Conditions & gt;
& lt; action type = "redirect" url = "https: // {http_host} {request_uri}" redirecttype = "permanent" / & gt;
& lt; / rule & gt;
& lt; / rules & gt;
& lt; / rewrite & gt;
& lt; /system.webserver>
& lt; / configuration & gt;
tried like this – does not want to work:
& lt; configuration & gt;
& lt; System.WebServer & GT;
& lt; rewrite & gt;
& lt; rules & gt;
& lt; rule name = "redirect to https" stopprocessing = "True" & gt;
& lt; match url = "(. *)" / & gt;
& lt; Conditions logicalGrouping = "Matchall" & gt;
& lt; add input = "{https}" pattern = "off" ignorecase = "true" / & gt;
& lt; add input = "{Request_uri}" negate = "true" pattern = "^ / robots \ .txt $" ignorecase = "true" / & gt;
& lt; / Conditions & gt;
& lt; action type = "redirect" url = "https: // {http_host} {request_uri}" redirecttype = "permanent" / & gt;
& lt; / rule & gt;
& lt; / rules & gt;
& lt; / rewrite & gt;
& lt; /system.webserver>
& lt; / configuration & gt;
Answer 1
I was looking for solutions for so long that I forgot the most elementary. Clean the cache browsers. . . So the solution is fully working.