Manual:generateSitemap.php

From MediaWiki.org

Jump to: navigation, search
MediaWiki File: generateSitemap.php
Location: /maintenance/
Source code: HEAD

1.15.11.14.11.6.12

Classes: None


generateSitemap.php is used to (as the name implies) generate a sitemap for search engine robots such as googlebot. The default setting compresses the output, creating an index file(xml) and a zip file for every namespace that has content.

  • Side note: When using generateSitemap.php you can add --help to get a list of options for its use.
  • Tech note: generateSitemap.php uses gzdopen, which requires RPM libmysqlclient.so.15. If you do not have this RPM installed you might run into this error: php: relocation error: php: symbol gzdopen, version libmysqlclient_15 not defined in file libmysqlclient.so.15 with link time reference , to "skip" this error without installing the libmysqlclient RPM, you can use --compress=no. This will cause the output from the script to be non-compressed.

[edit] Options

--help

show this message

--fspath=<path>

The file system path to save to, e.g /tmp/sitemap/

--server=<server>

The protocol and server name to use in URLs, e.g.
http://en.wikipedia.org.
This is sometimes necessary because server name detection may fail in command line scripts and will show up only as "localhost" in the xml files.
(included in 1.12.0; may not be included in 1.14.0 (verification needed)

--compress=[yes|no]

compress the sitemap files, default yes

[edit] Alternative Version