Answer the question
In order to leave comments, you need to log in
How to set a redirect rule for multilingualism?
The site is multilingual, but because of this, there were problems with opening the site map (there are several of them). The map is successfully opened by url, mysite.my/RU_ru_sitemap_16-11-2020.xml
but if the current language is present in the url - 404, for example mysite.my/ru/RU_ru_sitemap_16-11-2020
I try this, but it does not work
location ~ ^.*\.xml$ {
if ($request_uri ~* "([^\/]{3,})\.xml?" ) {
set $last_path_component $1;
return 301 /$last_path_component;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question