Topic on Project:Support desk

Problem getting Google to find sitemap

8
Lieutenant S. Reznov (talkcontribs)

I just created a sitemap at en.sturmkrieg.com/sitemap.xml and added it with Google Webmaster Tools, but it gets a 404 error. I tried adding two lines to .htaccess since the problem could be getting redirected by the short url, but it didn't work; I could have just written it wrong.

RewriteCond %{REQUEST_URI} ^/sitemap.xml$
RewriteRule ^.*$ - [L]

I based it off of the code here for fixing the stats page of Dreamhost wikis, since it looks like it's fixing the problem of the URL being treated as a wiki page.

Did I guess the problem right? How would I go about fixing it?

en.sturmkrieg.com/robots.txt seems to be fine.

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

MarkAHershberger (talkcontribs)

Is the sitemap.xml file in the same directory or folder as the robots.txt file? What else is in your .htaccess file?

Lieutenant S. Reznov (talkcontribs)

Yes.

I also have this:

RewriteRule .*\.ico$ - [L]
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(skins|stylesheets|images|config)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index|api|load).php
RewriteRule ^(.*)$ /index.php?title=$1 [L,QSA]

For the short URLs and enabling the favicon. I remember reading here that it's necessary to have that line to get the favicon to work with short URLs.

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

MarkAHershberger (talkcontribs)

It looks like your web server might not even be seeing the rule for sitemap.xml.

Try this:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?title=$1 [L,QSA]

The line that ends !-f should eliminate the need to special-case the ico file, sitemap file, and any other file that actually exists.

As a result, all other requests for page names and such should be handled by MediaWiki.

In other words, the bit I've posted should be all you need in to handle short urls.

Lieutenant S. Reznov (talkcontribs)

Thank you!

Would this make it possible to have another wiki in a subdirectory? Relocating en40k.sturmkrieg.com to en.sturmkrieg.com/40k/Page_title

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

MarkAHershberger (talkcontribs)

No. It would be a start, but you'd probably need another copy of MediaWiki in the 40k subdirectory.

Lieutenant S. Reznov (talkcontribs)

Does excluding pages from the sitemap mean that they won't appear in search results, or does it just make them not rank as high? I'm currently using the extension for sitemaps, at least until I get the problem with the scripts fixed.

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

Reply to "Problem getting Google to find sitemap"