XF 2.2 Confused by sitemaps...

RobParker

Well-known member
Could someone explain how XF creates sitemaps as I think I'm missing something.

The admin page says:
If this option is enabled, the sitemap will be rebuilt automatically periodically. If this option is disabled, the sitemap will only be updated when it is rebuilt manually through Tools > Rebuild caches. The current sitemap can be accessed via sitemap.php.

That link to sitemap.php is ourdomain.co.uk/sitemap.php but that contains the following:

<sitemapindex>
<sitemap>
<loc>https://www.ourdomain.co.uk/sitemap-1.xml</loc>
<lastmod>2021-08-13T22:38:22+00:00</lastmod>
</sitemap>
<sitemap>
<loc>https://www.ourdomain.co.uk/sitemap-2.xml</loc>
<lastmod>2021-08-13T22:38:22+00:00</lastmod>
</sitemap>
</sitemapindex>

Those 2 xml files don't exist (404 errors).

Do I have something configured incorrectly?
 
Solution
A rather long story short, you will need full friendly URLs enabled for the sitemap URLs that end in .xml to actually work.

Once the sitemap grows beyond 50,000 URLs it has to be split into separate .xml files, as in your case. Prior to the 50,000 URLs limit, sitemap.php will work but in reality we've seen Google ignore sitemaps unless they have a .xml extension.

Once you have full friendly URLs enabled, you can actually just use the URL sitemap.xml to access the index page and then sitemap-1.xml and so on will work.
but it seems if you remove "ping?" the links do not work -- and I prefer we submit ourselves to the search engines rather than just hope they find us.
That's the point I'm trying to make... neither one of those entries require (nor want) you "submitting" your sitemap to them using the XF process now. Both should be removed and that check box unchecked unless you have other search engine sites that will allow submission by that method then you can place them in there.

 
Our site is installed in the root.

As I said, ourdomain.co.uk/sitemap.php exists and contains what I pasted above.

Neither sitemap-1.xml or sitemap-2.xml exist though (404).
 
Does it try to write a real file to that sitemap-1.xml location? Which user does it do that as? Could it be a filesystem permission issue? I'd assume an error would show somewhere if it couldn't write the file?
 
Top Bottom