Answer the question
In order to leave comments, you need to log in
Nginx redirect from specific url to file?
The site uses subdomains, subdomains are managed through the site engine, i.e. each subdomain does not have folders, you need to create your own sitemap.xml for each subdomain, how to make it so that when you open subdomain.domain.com/sitemap/sitemap.xml, the file that actually finds domain.com/subdomain/sitemap.xml opens. Let me remind you that the subdomain is controlled through the engine.
Answer the question
In order to leave comments, you need to log in
If the difference is only in the domain, you throw a sitemap for one site, and in Nginx you write like this.
location ~ \.xml$ {
sub_filter_once off;
sub_filter_types *;
sub_filter_last_modified on;
sub_filter 'site.ru' $host;
}
location = /sitemap.xml {
alias /var/www/site.ru/sitemap-$host.xml;
}
location = /sitemap.xml {
rewrite ^.*$ /sitemap-$host.xml break;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question