Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
LemonWiki共筆
Search
Search
Appearance
Log in
Personal tools
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Google Sitemaps for MediaWiki
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
<< [[MediaWiki]] "The Sitemap Protocol allows you to inform search engines about URLs on your websites that are available for crawling." (Quoted from [https://www.google.com/webmasters/tools/docs/en/protocol.html Google Sitemap Protocol]) [http://www.thinklemon.com/wiki/MediaWiki:Google_Sitemaps Google Sitemaps for MediaWiki] list all URLs of wiki pages for crawling, {{Wiki version| wiki_engine=MediaWiki | version=1.4, 1.11.0 }} == Installation == * Upload the [http://www.thinklemon.com/wiki/MediaWiki:Google_Sitemaps Google Sitemaps] v0.3 script to the same folder where LocalSettings.php located. * Add the Sitemap to [https://www.google.com/webmasters/tools/siteoverview Google webmasters tool] or [https://siteexplorer.search.yahoo.com/mysites Yahoo! Site Explorer]. ([[Promote your websites]]...) == Troubleshooting: URL are the same http://wiki.example.com/ == URLs of wiki page <loc> at Sitemap file are the same URL: http://wiki.example.com/ not the correct URL of each wiki page: http://wiki.example.com/index.php/Page_Name The correct Sitemap may appeared as follows ([https://www.google.com/webmasters/tools/docs/en/protocol.html Sitemap Protocol]): <pre> < url> < loc>http://wiki.example.com/index.php/Page_Name</loc> < lastmod>2005-01-01</lastmod> < changefreq>monthly</changefreq> < priority>1</priority> </url> </pre> I modified the partial code as follows: === original code === <pre> # ----------------------------------------------------- # Start output # ----------------------------------------------------- ?> <url> <loc><?php echo fnXmlEncode( "http://" . $wgServerName . eregi_replace('\$1',$sPageName,$wgArticlePath) ) ?></loc> <lastmod><?php echo fnTimestampToIso($row_rsPages['page_touched']); ?></lastmod> <changefreq>weekly</changefreq> <priority><?php echo $nPriority ?></priority> </url> <?php } while ($row_rsPages = mysql_fetch_assoc($rsPages)); ?> </urlset> </pre> === modified code === <pre> # ----------------------------------------------------- # Start output # ----------------------------------------------------- ?> <url> <loc><?php echo fnXmlEncode( "http://" . $wgServerName ) ?>/index.php/<?php echo fnXmlEncode( $sPageName ) ?></loc> <lastmod><?php echo fnTimestampToIso($row_rsPages['page_touched']); ?></lastmod> <changefreq>weekly</changefreq> <priority><?php echo $nPriority ?></priority> </url> <?php } while ($row_rsPages = mysql_fetch_assoc($rsPages)); ?> </urlset></pre> Further reading * [http://www.chieftain.idv.tw/archives/2008/01/21/1334.html Reflection » Blog Archive » Mediawiki 的 Google Sitemaps 製作] (last visited: 2008-02-10) [[Category:MediaWiki]] [[Category:Web_Dev]]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki共筆:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Template:Wiki version
(
edit
)