From a87116b3c3d5800fe74050e75f5403719e357a7b Mon Sep 17 00:00:00 2001 From: Max Girkens Date: Mon, 20 Oct 2014 16:43:01 +0200 Subject: [PATCH] add X-Robots-Tag header adding the X-Robots-Tag header might be a good thing, as it prevents the sitemap itself from getting indexed by google and showing up in the SERPs see https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag --- code/controllers/GoogleSitemapController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/controllers/GoogleSitemapController.php b/code/controllers/GoogleSitemapController.php index 1cf4ba2..b6168df 100644 --- a/code/controllers/GoogleSitemapController.php +++ b/code/controllers/GoogleSitemapController.php @@ -33,6 +33,7 @@ class GoogleSitemapController extends Controller { Config::inst()->update('SSViewer', 'set_source_file_comments', false); $this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"'); + $this->getResponse()->addHeader('X-Robots-Tag', 'noindex'); $sitemaps = GoogleSitemap::get_sitemaps(); $this->extend('updateGoogleSitemaps', $sitemaps); @@ -59,6 +60,7 @@ class GoogleSitemapController extends Controller { Config::inst()->update('SSViewer', 'set_source_file_comments', false); $this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"'); + $this->getResponse()->addHeader('X-Robots-Tag', 'noindex'); $items = GoogleSitemap::get_items($class, $page); $this->extend('updateGoogleSitemapItems', $items, $class, $page);