I use wpmu (soon to be named wordpress multisite – wpms?) for most of my many mini niche sites. It makes it easy to install, backup, and whip up new sites.
Arne’s google sitemap generator is the best sitemap plugin period so rather than use anyone else’s custom wpmu sitemap solutions, I’ve opted to hack Arne’s.
Way back in 2006, I used to hack the default InitOptions() function to use a manual file location. Nowadays, I find it much easier to just change what it thinks is the default location.
function GetHomePath() {
/* comment everything out and just have the following line */
return ABSPATH . UPLOADS;
}
Next, I need to make sure that the wordpress upload directory has already been created.
function BuildSitemap() {
global $wpdb, $posts, $wp_version;
$this->Initate();
//workout what the upload directory for this blog is
$upload_dir = ABSPATH . UPLOADS;
//create the directory if it does not already exist
wp_mkdir_p($upload_dir);
...
That’s it. Simple. Now just redirect all requests for the sitemap to the generated file location. Here I use .htaccess files
#sitemap
RewriteRule ^sitemap.xml$ wp-content/blogs.php?file=sitemap.xml [L]
RewriteRule ^sitemap.xml.gz$ wp-content/blogs.php?file=sitemap.xml.gz [L]
That’s it. Works for Google Sitemap Generator v3.2.2