[pmwiki-users] htaccess redirect if not exist

Eemeli Aro eemeli at gmail.com
Sun Aug 1 04:02:51 CDT 2010


On 30 July 2010 04:27,  <pmwiki at 911networks.com> wrote:
> What I'd like to happen is that the default becomes /pm2/site-new and
> if the webpage requested doesn't exist in /pm2/site-new, then switch
> to /pm1/site-existing where the existing page is still there.

Alternatively, modify your $WikiLibDirs to contain both. Something
like this (untested):

$OldWikiDir = new PageStore('/path/to/pm2/site-existing/wiki.d/{$FullName}');
$WikiLibDirs = array_splice($WikiLibDirs, 1, 0, $OldWikiDir);

Then (assuming you've got the default to look for a page in
/pm1/site-new) accessing a page will first look for it there, then in
/pm2/site-existing. The first one where it's found is presented. If
you edit a page that's only in /pm2/site-existing, it'll get copied
and saved to /pm1/site-new completely transparently.

Eventually you'll need to figure out (outside of PmWiki) if you have
any more pages left in /pm2 that haven't been updated, and handle
those so that you can remove the above two lines from your config.

eemeli



More information about the pmwiki-users mailing list