Answer the question
In order to leave comments, you need to log in
Intercept the request to https://site.ru/sitemap.xml and send it to https://site.ru/seo_cap_sys/sitemap-general.php. Is it real?
Good day!
Task 1. Intercept the request to https://site.ru/sitemap.xml and send it to https://site.ru/seo_cap_sys/sitemap-general.php
Task 2
More complex
Intercept requests to https://site.ru/ sitemap1.xml and redirect to https://site.ru/seo_cap_sys/sitemap.php?num=1
where sitemap1.xml is the number after the sitemap and before the dot should go to https://site.ru/seo_cap_sys/sitemap.php ?num=1 - num parameter
Answer the question
In order to leave comments, you need to log in
Second option
Task 2
More complex
Intercept requests to https://site.ru/sitemap1.xml and redirect to https://site.ru/seo_cap_sys/sitemap.php?num=1
where sitemap1.xml is the number after the sitemap and before the dot go to https://site.ru/seo_cap_sys/sitemap.php?num=1 - num parameter
More or less like this:
if($_SERVER['REQUEST_URI'] === '/sitemap.xml'){
require('sitemap-general.php');
}
if($_SERVER['REQUEST_URI'] === '/sitemap1.xml'){
require('sitemap.php?num=1');
}
It is also possible in .htaccess:
RewriteRule ^sitemap.xml/?$ /sitemap-general.php [L]
A few years ago, I did similar experiments with redirects. It's quite real. But both Ya.Webmaster and Google.Webmaster refused to process a link to https://site.ru/sitemap.xml with such a redirect, and, therefore, the idea turned out to be meaningless.
there is a third option, do not deal with crap,
but read on the Internet as the search engines themselves recommend.
1. Add the sitemap directive with its address to the robots.txt file
2. https://webmaster.yandex.ru/site/indexing/sitemap/
3. https://www.google.com/webmasters/tools/sitemap-li ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question