I was having troubles getting the wordpress plugin Google Sitemaps to work with WordPressMU. The plugin appeared to work great for the parent site, but if any sub-sites enabled the plugin their creation of a sitemap would overwrite the parent’s sitemap. And even if the individual user enterd a manual path for their sitemap, the file served up by http://subdomain.domain.com/sitemap.xml would still be the parent site’s file.
Finally, I found a WPMU adjusted version at this site http://www.studinski.dk/sitemap-wpmu.txt. First, I copied this plugin into my mu-plugins folder and it wasn’t recognized for some reason. Then, I moved the plugin into the standard plugins folder and it was recongized.
I still had to make a few adjustments before it worked just right. I had to edit this plugin and replace the /absolute/path/wp_inst// with my own absolute path to my installation. But then I was still having the problem that this new plugin now adjusted the location of the sitemap.xml to the /wp-content/blogs.dir/#/files directories, but that only fixed the overwriting problem. There was still a problem when google would actually try to access the file. The RewriteRules in the .htaccess file was still forcing everything to the root sitemap.xml file.
Also, google wants to see the sitemap in the root of your website and not in the files subdirectory. So I was able to fix this by adding this to my .htaccess file immediately below the
# Rewrite www.domain.com to domain.com
#RewriteCond %{HTTP_HOST} ^www\.(.*)
#RewriteRule ^(.*) http://%1/$1 [R,L]
My RewriteRule looks like this:
#send sitemap.xml to each sub-site
RewriteRule ^sitemap.xml wp-content/blogs.php?file=sitemap.xml [L]
And this is now working great for me. If you put these lines too far down in the file, then the request will be rewritten before it gets to the lines.
Good Luck!
Pingback by WordPress MU ????????????? - ????????
# December 22, 2008, 5:14 am |
[…] MU ?????????????????????WordPressMU and Google Sitemaps ?????????????? Google XML Sitemaps […]
Pingback by WordPress MU ????????????? - ????????
#1 November 29, 2008, 5:19 am |
[…] MU ?????????????????????WordPressMU and Google Sitemaps ?????????????? Google XML Sitemaps […]
Pingback by WordPress MU ????????????? - ????????
#2 November 21, 2008, 12:36 am |
[…] MU ?????????????????????WordPressMU and Google SitemapsĀ ?????????????? Google XML […]