GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   WPMU 3.0 and sitemaps! (https://gfy.com/showthread.php?t=976372)

CaptainWolfy 07-03-2010 02:02 PM

WPMU 3.0 and sitemaps!
 
Ok so i had a problem, not a single plugin for creating sitemaps for wpmu 3.0, Google XML Sitemaps doesn't support mu version so i had to do a little tweaking.

first of all edit the file wp-content/plugins/google-sitemap-generator/sitemap.php
Code:

//Check for 3.0 multisite, NOT supported yet!
// if((defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE) || (function_exists('is_multisite') && is_multisite())) {
//      if(function_exists('is_super_admin') && is_super_admin()) {
//              add_action('admin_notices',  array('GoogleSitemapGeneratorLoader', 'AddMultisiteWarning'));
//      }
//
//      return;
// }

delete those lines!

That's to lose that annoying thing of not working blah blah blah
than
edit the function GetXmlPath in sitemap-core.php
Code:

function GetXmlPath($forceAuto=false) {
        if(!$forceAuto && $this->GetOption("b_location_mode")=="manual") {
                $xml_path = $this->GetOption("b_filename_manual");
        } else {
                $xml_path = $this->GetHomePath()  . $this->GetOption("b_filename");
        }
        if((defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE) || (function_exists('is_multisite') && is_multisite())) {
                return str_replace('sitemap.xml', 'sitemaps/sitemap.'.$_SERVER['HTTP_HOST'].'.xml', $xml_path);
        }
        return $xml_path;
}

next create dir in your root called sitemaps chmod it to 777
and the last thing is to add this to your .htaccess file
Code:

RewriteRule ^sitemap.xml sitemaps/sitemap.%{SERVER_NAME}.xml [L]
RewriteRule ^sitemap.xml.gz sitemaps/sitemap.%{SERVER_NAME}.xml.gz [L]

That's it enjoy in using the tweaked version, btw don't forget if you update your plugin all the tweaks will be lost, hope i helped you! Cheers!:pimp

fris 07-03-2010 02:35 PM

heres a link

http://blog.dembowski.net/2010/06/09...ess-multisite/


All times are GMT -7. The time now is 04:06 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123