Extension:DynamicWikiSitemap

The DynamicWikiSitemap extensions adds a separate sitemap page. It will update itself automatically, which is useful if you update your website on a regular basis.

The XML file has the following properties:
 * it is sorted by decreasing article popularity (ie. highest number of hits). However, you can configure it.
 * it contains articles only : no redirection pages, nor any other special/external page. However, you can configure it.

In order to produce more relevant Sitemaps, DynamicWikiSitemap Extension can also estimate the revision frequency of your pages and associate them a priority according various schemes.

Installation
Download the latest version and extract it into the root directory of your MediaWiki installation(the same directory that holds LocalSettings.php).

Note: No need to register the sitemap.php at LocalSettings.php(there you can only set configuration).

Note: The extension works properly only when installed in the root directory.

These actions is enough to install, but you can use URL Rewriting to make it URL more clean and simple.

URL Rewriting
First, create a .htaccess file, located at the root directory, or modify the .htaccess file you may already have:

This way, sitemap.php will allow us to automatically generate the content of the XML file (the real Sitemap). Each time search engine will try to open sitemap.xml, sitemap.php will be executed and will make an update of the XML file.

Then add the following lines to your LocalSettings.php file (near the end):

Configuration parameters
There are various options for extension, you can put them into your LocalSettings.php file (before the "require once") line. However, extension should work even out-of box.

Exclude types of pages from sitemap

 * $wgDynamicWikiSitemapExclude: an array defining the excluded namespaces.
 * $wgDinamicWikiSitemapExclude : an array defining the excluded namespaces. Deprecated as of 0.1.3 version, July 2011 use $wgDynamicWikiSitemapExclude instead.

Setting base url other then $wgServer

 * $wgDynamicWikiSitemapServerBase: base url.
 * $wgDinamicWikiSitemapServerBase : base url. Deprecated as of 0.1.3 version, July 2011 use $wgDynamicWikiSitemapServerBase instead.

Exclude pages from sitemap by name

 * $wgDynamicWikiSitemapExcludeSites: an array defining the excluded pages.
 * $wgDinamicWikiSitemapExcludeSites : an array defining the excluded pages. Deprecated as of 0.1.3 version, July 2011 use $wgDynamicWikiSitemapExcludeSites instead.

Setting priority
You can use following priority schemes:
 * $wgDynamicWikiSitemapArticlePriority: the priority scheme to use in a tag. Default is DWS_PRIORITY_CONSTANT.
 * $wgDinamicWikiSitemapArticlePriority : the priority scheme to use in a tag. Deprecated as of 0.1.3 version, July 2011 use $wgDynamicWikiSitemapArticlePriority instead.
 * constant: all priorities is 0.5 (configuration constant DWS_PRIORITY_CONSTANT);
 * linear: (configuration constant DWS_PRIORITY_LINEAR);
 * quadratic: (configuration constant DWS_PRIORITY_QUADRATIC);
 * cubic: (configuration constant DWS_PRIORITY_CUBIC</tt>);
 * exponential: (configuration constant DWS_PRIORITY_EXPONENTIAL</tt>);
 * smooth: (configuration constant DWS_PRIORITY_SMOOTH</tt>);
 * random: (configuration constant DWS_PRIORITY_RANDOM</tt>);
 * reverse: (configuration constant DWS_PRIORITY_REVERSE</tt>).

See various schemes for details.

Setting cange frequencies

 * $wgDynamicWikiSitemapEstimateChangeFreq: enable to estimate the revision frequency. Default is false.
 * $wgDinamicWikiSitemapEstimateChangeFreq : enable to estimate the revision frequency. Deprecated as of 0.1.3 version, July 2011 use $wgDynamicWikiSitemapEstimateChangeFreq</tt> instead.

Setting sitemap limit

 * $wgDynamicWikiSitemapLimit: maximum number of articles at a sitemap page. Default is 10000.
 * $wgDinamicWikiSitemapLimit : maximum number of articles at a sitemap page. Deprecated as of 0.1.3 version, July 2011 use $wgDynamicWikiSitemapLimit</tt> instead.

Note: At exceeding the number of pages, the sitemap works at sitemap index mode.

Setting sorting criterion

 * $wgDynamicWikiSitemapSortingCriterion: the sorting criterion of sitemap articles. Default is DWS_SORTING_POP</tt>.
 * $wgDinamicWikiSitemapSortingCriterion : maximum number of articles at a sitemap page. Deprecated as of 0.1.3 version, July 2011 use $wgDynamicWikiSitemapSortingCriterion</tt> instead.

You can use following sorting schemes:
 * popularity:sort descending by popularity (configuration constant DWS_SORTING_POP</tt>)
 * last revision:sort descending by last revision (configuration constant DWS_SORTING_REV</tt>)
 * page ID:sort descending by page ID (configuration constant DWS_SORTING_PAGE_ID</tt>)

Note: At mode with sitemap index available only DWS_SORTING_PAGE_ID</tt> sorting scheme.

Setting short URL

 * $wgDynamicWikiSitemapShortUrl: The base URL used to create sitemap page links at sitemap index mode.

Note: Requires URL Rewriting configuration.