DokuWiki

It's better when it's simple

用户工具

站点工具


zh:sitemap

currently translating FIXME

Google Sitemap

DokuWiki 可以自动建立 XML Sitemap。适用于各大搜寻引擎,例如:Google,Yahoo and Microsoft。

要开啟这个功能请设定 'sitemap option'。在开啟这个功能之后, DokuWiki 会试着在你 DokuWiki 的根目录中建立一个名称為 sitemap.xml.gz 的 sitemap 。你必须确定 DokuWiki 可以写入这个档案。如果根目录无法开啟写入权限,你必须在根目录下建立一个空的档案,取名為 sitemap.xml.gz ,并设定好权限。

在建立一个新的sitemap之后,DokuWiki 经由 “ping” ,通知下列搜寻引擎有新的 sitemap 了。

  • Google
  • Yahoo
  • Microsoft Live/MSN

备註:

  • 如果 'gzip_output'是开啟的(预设值),那麼 DokuWiki 会使用 sitemap.xml.gz。而如果 'gzip_output' 是关闭的,则会使用 sitemap.xml
  • Google sitemap 有个网站拥有者认证服务。对 DokuWiki 来说,实行这个选项最简单的方式是「上传一个 HTML 档」。假设http://your.site.tld/dokuwiki_basedir/是你的网站,首先建立一个 Google 建议的档案,如http://your.site.tld/dokuwiki_basedir/googlexyz.html(使用者必须可读)。然而,為了让这个功能可以运作,你必须也同时开啟 'send404'。原因是因為对于不存在的页面, DokuWiki 预设回传 “200 OK”。Google 对于不存在的页面预期的回应用是 “404 Not Found”。所以当 Google 测试一个虚构的网页(如 http://your.site.tld/dokuwiki_basedir/noexist_xyz.html),然后得到 “200 OK” 的回应,它会取消这个认证。
  • dokuwiki-2006-03-09 有一个 bug ,会让 sitemap 建立或更新时自动 “ping” Google 导向错误的 sitemap URL 。更多资讯请见http://bugs.dokuwiki.org/?do=details&id=815
  • indexer 產生 Sitemap。要手动执行及 debug ,请使用:http://yourserver/dokuwiki/lib/exe/indexer.php?debug=1

权限设定

To be able to create a sitemap, the Webserver needs to have write access to the sitemap file. 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.

To force your sitemap to be re-created, try temporarily setting the sitemap option to a large, negative value.

Sitemap Validity

Sitemaps are bound to a domain name. If your sitemaps contains URLs of the form http://domain.org, the sitemap will not be valid when pulled from http://www.domain.org 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 ^(.*)$       http://www.domain.org/$1 [R,L]

延伸阅读

1)
See permissions on tips about permission setting
zh/sitemap.txt · 最后更改: 2014-02-27 02:26 由 Klap-in

除额外注明的地方外,本维基上的内容按下列许可协议发布: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki