It's better when it's simple

User Tools

Site Tools


Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community

Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy


Google Sitemap

DokuWiki can automatically create an XML Sitemap used by several big search engines like Google, Yahoo, and Microsoft.

Before continuing, enable sitemap creation by setting the sitemap properties under Configuration Settings. The sitemap is placed in the cache subdirectory of your DokuWiki installation. It will be accessed by the following type of URL http://your_domain/dokuwiki/doku.php?do=sitemap. Depending on the availability of gzip support in your PHP install it will either be named sitemap.xml.gz (when gzip is available) or sitemap.xml (with no gzip support). Nearly all modern PHP installs have gzip support enabled, so sitemap.xml.gz is your best guess.

When the sitemap is updated, DokuWiki will inform the following search engines automatically through a HTTP “ping”:

Note: the sitemap will only contain pages that are readable by the public without logging in.

:!: TODO: ?do=sitemap MUST allow restriction to namespaces. You can always have multiple sitemaps for different purposes and ?do=sitemap&ns=some_ns&ns=… must be supported.

Permission Setup

To be able to create a sitemap, the webserver needs to have write access to the sitemap file in /data/cache. The easiest way to make sure it has, is to create an empty sitemap.xml.gz file and change its permissions accordingly1).

If your sitemap won't be created you can try to get some debug output from the indexer by calling http://yourserver/dokuwiki/lib/exe/indexer.php?debug=1 in your browser.

Sitemap Validity

Sitemaps are bound to a domain name. If your sitemaps contains URLs of the form, the sitemap will not be valid when pulled from and vice versa. To make sure a canonical URL is used you can either configure the baseurl setting or redirect “mismatching” URLs via another rewrite rule in your .htaccess:

Rewrite example (Apache):

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.org$      [NC]
RewriteRule ^(.*)$$1 [R,L]

Read more


If my domain is a virtual host set to an farm animal, will the ?do=sitemap work? For me, I have got an empty sitemap.xml.gz from my . How should I fix it? — MilchFlasche 2019-04-02 16:45

* I think it works. Your link is working alright. It returned a gz file as described above. That contained a folder inside which there is one file called sitemap. It had lots of valid links. The arrangement looks odd though. — Jyoti 2019-05-20 11:03

See permissions on tips about permission setting
sitemap.txt · Last modified: 2019-05-20 11:04 by jyoti