0

This question already has an answer here:

I use Yii PHP framework to generate sitemaps of user profiles. The sitemap url is something like this

http://mywebsite.com/site/sitemap33449

This URL returns xml of the sitemap. (with correct header type).

I submit this sitemap using google webmaster tool. In the google search result this link is also visible.

I used the following code in my .htaccess file. But no luck

<IfModule mod_rewrite.c>
  <FilesMatch "site/sitemap33449">
Header set X-Robots-Tag "noindex"
</FilesMatch>
 </IfModule>

How I fix this issue? Any kind of help is highly appreciated

marked as duplicate by Stephen Ostermiller Apr 3 '15 at 23:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    The duplicate question has the correct syntax for the htaccess directive. – Stephen Ostermiller Apr 3 '15 at 23:40
  • 1
    The <FilesMatch> (and <Files>) directives match against the basename, not the full file path. – MrWhite Apr 3 '15 at 23:44
0

It may be that Google is a bit confused. I see nothing that tells Google that it is a sitemap per se' though I am sure it is obvious to you an I. Remember that it is kind of difficult to distinguish all cases in code especially if you are a search engine with so many crazy sites out there doing "God knows what?" So you may have to help poor G out a bit.

Please keep in mind that "sitemap" in the name and XML that resembles a sitemap may not always be enough. I would think these are strong clues, but your complaint is not that uncommon. This happens from time to time but is not normal. I like to say, "When in doubt, follow tradition." Of course I am a bit old school so "What do you expect?"

It is possible that Google sees your sitemap as just another directory/page to index.

Following tradition where sitemaps are in the websites root directory and named sitemap.xml seems to work. In this case you can submit an index sitemap.xml (https://support.google.com/webmasters/answer/75712?hl=en) with your specific user profile sitemap referenced within it. If you already use a sitemap.xml, then you can rename it (hopefully) and reference that too. This should erase all doubt. If you have the opportunity to 404 error the old sitemap and have it created in the root with .xml as the file extension, that may help to speed things up a bit.

One other consideration. If you create a sitemap.xml file, it will be picked up by everyone eventually. If you just want only Google to see it, then you can name it google-sitemap.xml or something distinct and submit that.

Not the answer you're looking for? Browse other questions tagged or ask your own question.