Commit 6d69f2bf authored by gbyte.co's avatar gbyte.co

Issue #2878547 by ziomizar: Sitemap included in search results

parent 6d235a5d
......@@ -51,7 +51,10 @@ class SimplesitemapController extends ControllerBase {
}
// Display sitemap with correct XML header.
$response = new CacheableResponse($output, Response::HTTP_OK, ['content-type' => 'application/xml']);
$response = new CacheableResponse($output, Response::HTTP_OK, [
'content-type' => 'application/xml',
'X-Robots-Tag' => 'noindex', // Do not index the sitemap itself.
]);
$meta_data = $response->getCacheableMetadata();
$meta_data->addCacheTags(['simple_sitemap']);
return $response;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment