glensc / dokuwiki-plugin-pageredirect

Redirects page requests based on content
https://www.dokuwiki.org/plugin:pageredirect
19 stars 19 forks source link

Redirect leading to a blank page #35

Open ehakram opened 6 years ago

ehakram commented 6 years ago

Actual result: redirection showing a blank page. Expected result: redirection leading to the redirected page.

Cause: The metadata file was older than the wiki page. This is probably because various of my dokuwiki files (pages, meta, ...) where moved manually. The exception is thrown in the action.php file, at this lines:

    // verify metadata currency
    // FIXME: why
    if(@filemtime(metaFN($ID, '.meta')) < @filemtime(wikiFN($ID))) {
        throw new Exception('should not get here');
        return;
    }

Workaround: I fixed the issue by overwriting the meta file to update it's time.

schniepp commented 6 years ago

Wow. I just had the same problem on my page. If happened after moving to a new server, when I just copied everything over. That was a huge problem, because a larger part of my public web space was not available (silently) for a while. By commenting out the lines mentioned above, I was able to fix it quickly. Now, I need to figure out a better way of handling this and having a good policy for the future.

schniepp commented 6 years ago

OK, I found a fix: this web page has a phython (and php) script to get the timestamps back from the meta files: https://www.dokuwiki.org/tips:fixmtime I used the python script, and it worked perfectly. New policy is to make sure that time stamps do not get messed up during a move to a new server.