The MU forums have moved to WordPress.org

Google Sitemap (120 posts)

  1. Ovidiu
    Member
    Posted 17 years ago #

    well, have a look at this line:

    $res = '/home/suleiman/public_html/wp-content/';

    why would you put your sitemap.xml file into wp-content?
    I suggest changing it to this:


    $res = '/home/suleiman/public_html/';

    as that is your wpmu root dir. I cannot remember exactly how it looks for me, as I have no access right now but this seems logical.

  2. suleiman
    Member
    Posted 17 years ago #

    Thanks for the tip Ovidiu but I'm still getting the error oddly enough!

    Fatal error: Call to undefined function: graceful_fail() /public_html/wp-content/blogs.php on line 78

    The strange part is I can see my sitemap.xml file in the public_html folder, but google is complaining that it is unreadable.

  3. Ovidiu
    Member
    Posted 17 years ago #

    hi there,

    yesterday i tested what I was describing in my last 2-3 posts and it worked, google told me it had successfully picked up my sitemap, and now when I checked again.


    Fatal error: Call to undefined function: graceful_fail() in /var/www/web5/web/wp-content/blogs.php on line 78

    same like you. I am at a loss, maybe someone else can help us out?

  4. Ovidiu
    Member
    Posted 17 years ago #

    here are the lines that would matter:


    $file = $_GET[ 'file' ];

    $file = constant( "ABSPATH" ) . constant( "UPLOADS" ) . $file;
    if ( !is_file( $file ) ) {
    header("HTTP/1.1 404 Not Found");
    graceful_fail('404 — File not found.');
    }

    line 78 giving the error is the one saying: graceful_fail('404 — File not found.');

    I solved this one too :-)

    I had another closer look at the sitemap.php code of the modified version of the sitemap that is being used/circulated inside these forums and found a strange if clause:


    if(get_bloginfo('siteurl') != 'http://zice.ro') {
    global $blog_id;
    $res = '/var/www/web5/web/wp-content/blogs.dir/' . $blog_id . '/files/';
    } else {
    $res = '/var/www/web5/web/';
    }
    return $res;
    }

    so basically whenever the site that was generating the sitemap.xml was not the main blog the sitemap would be placed inside the /var/www/web5/web/wp-content/blogs.dir/' . $blog_id . '/files/ folder but when the main page generated a sitemap it was just placed inside the root where wpmu was installed.
    Take this in combination with drmikes rewrite rule :


    RewriteRule ^sitemap.xml /wp-inst/wp-content/blogs.php?file=sitemap.xml [L]

    posted here: http://mu.wordpress.org/forums/topic.php?id=1116&replies=33

    which would take any request for a sitemap.xml and try and find it inside the /var/www/web5/web/wp-content/blogs.dir/' . $blog_id . '/files/ folder I udnerstand now why I got those error.

    Now that I modified that if clause further up, all sitemap.xml files are being put into the "same" structure, only the blogid differs so all is well now :-)

  5. suleiman
    Member
    Posted 17 years ago #

    could you post your modified what if clause Ovidiu?

    And any other changes you needed to make to get this to work?

  6. Ovidiu
    Member
    Posted 17 years ago #

    thats an easy one :-)


    if(get_bloginfo('siteurl') != 'http://ziceeee.ro') {

    just write your domain with a type, that makes sure all sitemaps for your domain and subdomains get put into this structure:


    /wp-content/blogs.dir/' . $blog_id . '/files/

    of course there are more elegant solutions to this, buzt this works :-)
    you can eliminate the if clause totally as you do not want it

  7. suleiman
    Member
    Posted 17 years ago #

    hmmm...the line you are referring to is line 415 in my sitemap.php file, and unfortunately I already have it set as follows:

    if(!$forceAuto && $sm_options["sm_b_location_mode"]=="manual") {
    return $sm_options["sm_b_fileurl_manual"];
    } else {
    //URL comes without /
    if(get_bloginfo('siteurl') != 'http://hadithuna.com') {
    return get_bloginfo('siteurl') . "/" . "files/" . sm_go("sm_b_filename");
    } else {
    return get_bloginfo('siteurl') . "/" . sm_go("sm_b_filename");
    }
    }

    But I'm still getting the error. Were there any other modifications you made?

  8. Ovidiu
    Member
    Posted 17 years ago #

    ok, I think I udnerstand what you posted but where are your sitemap files?

    give me some info like this:

    main blog:
    ../wp-content/blogs.dir/' . $blog_id . '/files/sitemap.xml
    subdomainblog:
    ../wp-content/blogs.dir/' . $blog_id . '/files/sitemap.xml

    or does your mainblog sitemap location differ?

  9. suleiman
    Member
    Posted 17 years ago #

    for the subdomain blogs it is being created in the /files/sitemap.xml directory.

    for the mian blog it is not being created there, but in the main directory for the site. (i.e., http://hadithuna.com/sitemap.xml)

    EDIT: this is so frustrating. I just went into the sitemap options page and changed the directory from automatic detection to manual, pointing it to my /wp-content/blogs.dir/1/files/ folder. It generated the files perfect, and the link is even accessible in my browser, but going to add it to Google's Sitemap service throws out the following error:

    URL restricted by robots.txt
    We encountered an error while trying to access your Sitemap. Please ensure your Sitemap follows our guidelines and can be accessed at the location you provided and then resubmit.

  10. Ovidiu
    Member
    Posted 17 years ago #

    see?

    this rewrite rule:
    RewriteRule ^sitemap.xml /wp-inst/wp-content/blogs.php?file=sitemap.xml [L] could not pick up your sutemap.xml inside the root of the mainblog, so moving it to the files is the first step.

    now about your URL restricted by robots.txt error, what is the content of your robots.txt? do you have such a file in your web-root?

  11. suleiman
    Member
    Posted 17 years ago #

    RewriteRule ^sitemap.xml /wp-inst/wp-content/blogs.php?file=sitemap.xml [L]

    is all I have in my .htaccess file Ovidiu, I don't even have a robots.txt file anywhere on my install.

    I'm pretty sure wpmu doesn't come with one.

  12. suleiman
    Member
    Posted 17 years ago #

    wait, i have a question.

    For the "/wp-inst/wp-content/blogs.php" portion of the rewrite rule, are we supposed to replace "wp-inst" with our home directory name? If so then that could be the root of my worries...

  13. Ovidiu
    Member
    Posted 17 years ago #

    :-)

    I have installed wpmu into my webroot folder, therefore I cut away the /wp-inst portion and it works....

  14. suleiman
    Member
    Posted 17 years ago #

    So your .htaccess actually reads as follows:

    RewriteRule ^sitemap.xml /wp-content/blogs.php?file=sitemap.xml [L]

    ?

  15. Ovidiu
    Member
    Posted 17 years ago #

    it does and it works :-) give it a test...

  16. suleiman
    Member
    Posted 17 years ago #

    okay, i got google to pick up my sitemap finally!

    the only problem now is that none of the urls that were submitted can be followed because of a robots.txt restriction. I'm only submitting a site with 7 URL's and all 7 are getting blocked.

    I just don't understand because I have no robots.txt files!

  17. Ovidiu
    Member
    Posted 17 years ago #

    did you check your google webmaster control panel? it can actually display the content of your robots.txt file, go check what google thinks is in your robots.txt file...

  18. suleiman
    Member
    Posted 17 years ago #

    I did ovidiu, and bizarre though this may seem, when i run the url's google reports it can't find in my Web Crawl Stats section, in the robots.txt Analysis section each and every one of those urls checkes through.

  19. Ovidiu
    Member
    Posted 17 years ago #

    did you have a look at the date when you got those errors? google offers you the exact date when those errors occured, maybe they are old and you are worrying for nothing?

  20. suleiman
    Member
    Posted 17 years ago #

    you hit the nail on the head buddy.

    Thanks!

  21. ii55
    Member
    Posted 17 years ago #

    There is a plugin coming soon to solve all sitemap problems in MU check this thread here http://mu.wordpress.org/forums/topic.php?id=2844

  22. billnoyes
    Member
    Posted 17 years ago #

    This doesn't seem to be working on my installation. I am not using subdomains. Running WPMU 1.0 release and have no other errors. Whenever I install this sitemap plugin with the mods or the new orangecows version I cannot access my Dashboard when I login as Admin or any regular blog user. The Plugin seems to work with the exception of users getting a blank page after login. Any ideas on a fix for this one?

  23. ii55
    Member
    Posted 17 years ago #

    billnoyes you shure you placed into the mu-plugins folder. Thast the only place where you need to place the orangecows-sitemap plugin. If not then place a topic here http://forum.orangecows.com/viewtopic.php?t=4 and we will help you out for shure.

  24. billnoyes
    Member
    Posted 17 years ago #

    ii55. I have posted the problem on your site.

  25. JohnWeb
    Member
    Posted 17 years ago #

    I found that editors in specific blogs could change the settings while I wanted to reserve that for the administrator. So I changed line 155, notice the "8" to signify the option page is only available to administrator role and above.

    add_options_page('Sitemap', 'Sitemap', 8, 'SitemapAdmin', array('SitemapAdmin', 'options_page'));

  26. drmike
    Member
    Posted 17 years ago #

    I've been meaning to post about this but I got the 3.0beta working.

  27. kingler
    Member
    Posted 17 years ago #

    did you modify the 3.0beta version to make it work in WPMU?

  28. drmike
    Member
    Posted 17 years ago #

    Yup. Simple fix IIRC.

    Can't remember what I did and I haven't tested it for blog #1 but here it is:

    http://daria.be/sitemap.phps

    Someone please poke around and see if it works elsewhere. Kind of busy today...

  29. pixline
    Member
    Posted 17 years ago #

    For my active wpmu online - http://astio.net/ - it won't work, at least on blog #1. It fails on the very first ?rebuild=true and - after a reload - it say "There was a problem writing your sitemap file / zipped sitemap file. Make sure the file exists and is writable".

    My root is chmodded 777, and all kind of upload or file creation by wpmu is ok. For me it didn't work. Can I check something in details?

  30. peaceguide
    Member
    Posted 17 years ago #

    Ive downloaded from drmike's link, updated line 936 $res to reflect my server and get the following errors when i rebuild the sitemap manually for the first time.

    * The last run didn't finish! Maybe you can raise the memory or time limit for PHP scripts. Learn more
    * The last known execution time of the script was 0.01 seconds, the limit of your server is 30 seconds.
    * The script stopped around post number 3 (+/- 100)
    * If you changed something on your server or blog, you should rebuild the sitemap manually.

    what do i need to do?

About this Topic