Requested URL was not found on this server

My version 5.4.3 site no longer can find any pages other than the home page. In fact when I try to log in or look at any page, I get a was not found on this server message.


This problem occurred immediately after I logged in with admin.php and attempted to change the Timezone which is found under Preferences | System. Unfortunately I had not backed the system up prior to making this change AND I had not taken the system offline prior to making the change. Does anyone have suggestions how I can make the site operational again? I have examined the config file and noted that it had not changed (date didn't change) as a result of making this change. Is there something I can change in the MySQL database to make this work again?


My server does not support mod-rewrite even though there still is a check in the last entry on the System page (Use mod_rewrite).


The only thing that I can do is add ?page=HomePage/edit to the url and get the edit side of the page. I did that when I was logged in as administrator but now that I have closed my browser, I cannot get to the Login page or any page.


Thanks,


ray


Comments

  1. possible error sources

    I'll try to reproduce a state where this happens to select the possible error sources.

    Looks like the admin panel routine sets / overwrites a related value with en empty / false value in the config table (?)

    please check the following values in the config table:

    rewrite_mode

    • WikiAdmin
    • edited
  2. Fixed!

    Thank you. I found the value of the rewrite_mode to be 1. I changed this to 0 and now the wiki is running – with no lost data. Not sure why this all occured but at least we are up and going. Thank you, ray

    • Guest
  3. This is a valid bug

    I could reproduce the case within the admin panel (admin/modules/configsystem.php) and I also found the cause

    in admin.php

    // enable rewrite_mode to avoid href() appends '?page='
    if ($engine->config['rewrite_mode'] == false)
    {
    	$engine->config['rewrite_mode'] = 1;
    }


    I'll fix this soon.

  4. Patch for AP without rewrite_mode

    diff --git a/wacko/admin.php b/wacko/admin.php
    --- a/wacko/admin.php
    +++ b/wacko/admin.php
    @@ -35,6 +35,8 @@
     $init->settings('theme_url',    $init->config['base_url'].'themes/'.$init->config['theme'].'/');
     $init->settings('user_table',    $init->config['table_prefix'].'user');
     $init->settings('cookie_hash',    hash('md5', $init->config['base_url'].$init->config['system_seed']));
    +$init->settings('ap_mode',        true);
    +
     
     $init->settings('cookie_path',    preg_replace('|https?://[^/]+|i', '', $init->config['base_url'].''));
     
    @@ -72,12 +74,6 @@
         }
     }
     
    -// enable rewrite_mode to avoid href() appends '?page='
    -if ($engine->config['rewrite_mode'] == false)
    -{
    -    $engine->config['rewrite_mode'] = 1;
    -}
    -
     ########################################################
     ##            End admin session and logout            ##
     ########################################################
    diff --git a/wacko/classes/wacko.php b/wacko/classes/wacko.php
    --- a/wacko/classes/wacko.php
    +++ b/wacko/classes/wacko.php
    @@ -2437,7 +2437,19 @@
         // returns the full url to a page/method.
         function href($method = '', $tag = '', $params = '', $addpage = 0, $anchor = '')
         {
    -        $href = $this->config['base_url'].( $this->config['rewrite_mode'] ? '' : '?page=' ).$this->mini_href($method, $tag, $addpage);
    +        $_rewrite_mode = '';
    +        
    +        if ($this->config['ap_mode'] === true)
    +        {
    +            // enable rewrite_mode to avoid href() appends '?page='
    +            $_rewrite_mode = 1;
    +        }
    +        else
    +        {
    +            $_rewrite_mode = $this->config['rewrite_mode'];
    +        }
    +        
    +        $href = $this->config['base_url'].( $_rewrite_mode ? '' : '?page=' ).$this->mini_href($method, $tag, $addpage);
     
             if ($addpage)
             {
    @@ -2446,7 +2458,7 @@
     
             if ($params)
             {
    -            $href .= ($this->config['rewrite_mode'] ? '?' : '&').$params;
    +            $href .= ($_rewrite_mode ? '?' : '&').$params;
             }
     
             if ($anchor)


    See also bugs:447

    • WikiAdmin
    • edited