Answer the question
In order to leave comments, you need to log in
Yandex and 301 redirects are not friends?
I have a problem with the domain in Yandex webmaster. The server is configured like this:
server {
server_name www.domain.ru;
return 301 $scheme://domain.ru$request_uri;
}
server {
listen 80;
server_name domain.ru;
}
Answer the question
In order to leave comments, you need to log in
Make robots.txt accessible without a redirect:
location ~ ^(/robots.txt|/sitemap.xml|/sitemap_video.xml|/favicon.ico)$ {
root /var/www/example.com/html;
}
The final config, which allowed us to send the verification file and robots.txt directly without a redirect:
server {
server_name www.domain.ru;
location / {
return 301 $scheme://domain.ru$request_uri;
}
location ~ ^(/robots.txt|/sitemap.xml|/favicon.ico|/yandex_verification_file.html)$ {
root /var/www/user/domain.ru;
allow all;
log_not_found off;
access_logoff;
}
}
server {
listen 80;
server_name domain.ru;
root /var/www/nikolay/domain.ru;
index index.html index.htm index.php;
location ~ ^(/robots.txt|/sitemap.xml|/favicon.ico) {
allow all;
log_not_found off;
access_logoff;
}
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question