Answer the question
In order to leave comments, you need to log in
Is it possible to make two different Sitemaps for different domains but with the same root directory?
There are two domains that refer to the same folder.
For example site1.ru and site2.ru,
now the sitemap contains locs of the form site1.ru....
How to make it so that if you go to site2.ru/sitemap.xml, then the domain url in locs is site2.ru.. , and for site1.ru it is similar to site1.tu...?
Answer the question
In order to leave comments, you need to log in
.htaccess file
RewriteEngine On
RewriteBase /
RewriteRule sitemap.xml sitemap.php
$host=$_SERVER['HTTP_HOST'];
if($host=='site1.ru') echo file_get_contents('sitemap_xml_site1_ru.xml');
if($host=='site2.ru') echo file_get_contents('sitemap_xml_site2_ru.xml');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question