Menu

DotNetWikiBot : 404 page not found

Help
2008-03-26
2013-05-13
  • Protopopov Daniel

    I'm having problems getting a test page from inside GetPaths() with following code:
    HQSite = new Site("http://www.armadahq.com/wiki/", "Bot", "BotPassword");

    My site operates on index.php5, so I changed that in code as well, its not a concern (I think).
    I don't understand what that test is there for - whats the date there for...

    When running, at line 211, mainPage has value of "http://www.armadahq.com/wiki/index.php5?title=Main_Page", however indexPath fails in producing a group (it defaults to string.empty)

    Whole thing (404 page not found) is produced on DownloadString invocation at line 220.

     
    • CodeDriller

      CodeDriller - 2008-03-26

      Please, try removing /wiki/ from your URL:

      HQSite = new Site("http://www.armadahq.com", "Bot", "BotPassword");

      Does it work now?

       
      • Ppp

        Ppp - 2008-11-11

        No, I tried everything ...

        The wiki is accessible, yes, it's over at

        www.guiadebolsa.com/bolsa

        I tried

        www.guiadebolsa.com
        www.guiadebolsa.com/bolsa
        www.guiadebolsa.com/bolsa/index.php

        Always gives me the 404 error, even though I can log in normally using the bot's username and password.

         
        • CodeDriller

          CodeDriller - 2008-11-12

          I see. The problem is that short URLs are misconfigured. Bot doesn't understand the path "http://www.guiadebolsa.com/bolsa/index.php/Página_principal", it thinks that "index.php" is a script file.

          To fix that quickly you can set wikiPath and indexPath variables in DotNetWikiBot code manually in GetPaths() function, like that:

          ...
          webResp.Close();
          wikiPath = "/bolsa/index.php/";
          indexPath = "/bolsa/";
          Uri testPage = new Uri(site +
          ...

          And then recompile the framework.

          But it would be better to reconfigure the short URLs properly and remove that "/index.php/" from short path to pages. Short URLs configuration manual is located at http://www.mediawiki.org/wiki/Manual:Short_URL.

           
    • Protopopov Daniel

      I tried that, but it still fails on Line 220 where it tries to access test page, attempting to retrieve page "http://www.armadahq.com/wiki/8ca5e0c018dabba" (last part is DateTime bit). It misses "
      index.php5?" part there, correct code should be:

      Uri testPage = new Uri(site +
                      ((string.IsNullOrEmpty(indexPath) ? wikiPath : indexPath) + "index.php?title=") +
                      DateTime.Now.Ticks.ToString("x"));

       
      • CodeDriller

        CodeDriller - 2008-03-27

        There is no fundamental difference between index.php and index.php5. You should just carefully change this extension in EVERY place in the script. I guess, you've just forgotten to change it somewhere.

        For example, look at lines 200 and 201 - there are regular expressions, but you should change the extension there too. So it must be:

        Regex indexPathRE1 = new Regex("(?i)" + Regex.Escape(site) + "(/.+?/)index\\.php5\\?");
        Regex indexPathRE2 = new Regex("(?i)href=\&quot;(/[^\&quot;\\s<>?]*?)index\\.php5\\?");

        There is no problem with line 217, because "wikiPath" is an Apache server alias for "indexPath + "index.php?title="". Don't change it.

         
        • Ppp

          Ppp - 2008-11-10

          Still doesn't work, gives a 404 on the test page, same error.

           
      • CodeDriller

        CodeDriller - 2008-11-14

        I did some additional workaround in version 2.5. Try it.

         
    • Ppp

      Ppp - 2008-11-08

      I'm having the same problem. Did anyone find any solution?

       
      • CodeDriller

        CodeDriller - 2008-11-10
         
        • Ppp

          Ppp - 2008-11-10

          Still doesn't work, 404 all the same, it's on the test page ...

           
          • CodeDriller

            CodeDriller - 2008-11-11

            Is your wiki accessible from the Internet?

             
    • Ppp

      Ppp - 2008-11-10

      BTW, I am using MediaWiki 1.13.2, and the bot is Dotnetwikibot v2.4.

       
    • Ppp

      Ppp - 2008-11-13

      It was not misconfigured, that's a base installation, Mediawiki now behaves like that as per Mediawiki's site:

      "MediaWiki's default page addresses looks like these examples:

      http://example.com/w/index.php/Page_title (recent versions of MediaWiki, unless using CGI)
      http://example.com/w/index.php?title=Page_title (recent versions of MediaWiki, using CGI) "

      Afterwards I tried but didn't manage to get the short URLs running on this mediawiki (I have another where they run fine, different host).

      After trying the solution you gave me, it still doesn't work. I managed to get it logging in by hard coding the address, but it blows up a bit further along, because it produces bad URLs (I think it's the regex, which I really really hat ... all those hieroglyphs).

       
    • Ppp

      Ppp - 2008-11-13

      Well, now I've mostly taken care of the 404 problems, but on a Page.Load it gives me a 403 forbidden, and on a Save, it says this bot operation is not allowed even though I've given bot (and sysop, and bureocrat) permissions to the user ...

      Some of it seems to be MediaWiki 1.13.2, for instance, I have ConfirmEdit turned off YET Mediawiki STILL displays a math Captcha on every edit (even by sysops) !!

       
    • Ppp

      Ppp - 2008-11-13

      Well, I've solved all problems except for one, it gives me a 403 on Page.Load()

      One of the problems was because there was a mismatch between versions with ConfirmEdit (it's sensitive to the issue).

      Also something weird happened where "recent changes" is not updating. Ever came across that?

       
      • CodeDriller

        CodeDriller - 2008-11-13

        I can successively load pages from your site with Page.Load() , I don't get error 403.

         
    • Ppp

      Ppp - 2008-11-13

      Ups, that was dumb ... recent changes does not update because on preferences I don't have "bots" selected, so I don't see what they do ... heheh.

       
    • Ppp

      Ppp - 2008-11-15

      Ok, will do and report on it soon.

       
    • Ppp

      Ppp - 2008-11-15

      CodeDriller, v2.5 works PERFECT, not a single error.

       
    • Ppp

      Ppp - 2008-11-15

      Thanks very much, no doubt this is the best wikibot out there, at least for .NET.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.