From SpectLog
Jump to: navigation, search

Follow these steps to generate and expose your sitemap to the web.

Two simple steps

Change to the base directory of the WikiMedia installation and check whether the script for manual sitemap generation works:

php ./maintenance/generateSitemap.php --help

Generate the sitemap:

php ./maintenance/generateSitemap.php \
--fspath sitemap \
--identifier example \
--server \

The sitemap will be accessible using this URL:

Access restrictions for sitemap file

The command generates sitemap under ./maintenance/sitemap directory which can have restricted access. Instead of moving the directory somewhere else, when Apache HTTP server is used, .htaccess file with the following content can be placed into ./maintenance/sitemap directory:

Allow from all

Sitemap with default wiki namespace only

The problem is that the generated sitemap contains all wiki namespaces. Fortunately, the links are broken down into the files where each file contains only links to particular namespace.

It is easy to modify the XML file to remove all references except for the NS_0-0 only which lists links to default namespace. Open ./maintenance/sitemap/sitemap-index-example.xml file in editor and modify it to something similar:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="">