handle the soft 404 (file not found) for user and writer of DokuWiki by redirecting according to a configuration.
Compatible with DokuWiki
2009-03-16 (maybe earlier)
handle the soft 404 (file not found) for user and writer of DokuWiki by redirecting according to a configuration.
Similar to autosearch, autostart, goto, page_redirector, redirect
Download and install the plugin using the Plugin Manager using the following URL. Refer to Plugins on how to install plugins manually.
Note :
For writer :
For reader :
To know more about this plugin, please refer to this page : 404 Manager Plugin
I accidentally tried to redirect to a page that did not exist in the admin page, but the php died with
an error:
Fatal error: Call to undefined method admin_plugin_404manager::lang() in /www/wiki/lib/plugins/404manager/admin.php on line 93
Similar errors for other things.
Investigating I found that there appears to be a little bug in the script:
/** * handle user request */ function handle() { if($_POST['Add']){ $this->Vc_SourcePage = $_POST['SourcePage']; $this->Vc_TargetPage = $_POST['TargetPage']; if ( $this->Vc_SourcePage == $this->Vc_TargetPage ) { msg($this->lang('SameSourceAndTargetAndPage').': '.$this->Vc_SourcePage.'',-1); return; } if ( !page_exists($this->Vc_TargetPage) ) { if ($this->IsValidURL($this->Vc_TargetPage)) { $this->Vc_TargetPageType = 'Url'; } else { msg($this->lang('NotInternalOrUrlPage').': '.$this->Vc_TargetPage.'',-1); return; } } else { $this->Vc_TargetPageType = 'Internal Page'; } if ( page_exists($this->Vc_SourcePage) ) { $title = false; if ($conf['useheading']) { $title = p_get_first_heading($this->Vc_SourcePage); } if(!$title) $title = $this->Vc_SourcePage; msg($this->lang('SourcePageExist').' : <a href="'.wl($this->Vc_SourcePage).'">'.hsc($title).'</a>',-1); return; } $this->SetRedirection($this->Vc_SourcePage,$this->Vc_TargetPage); msg($this->lang['Saved'],1); }
The following lines should have square brackets and not round brackets:
85: msg($this->lang('SameSourceAndTargetAndPage').': '.$this->Vc_SourcePage.'',-1); 93: msg($this->lang('NotInternalOrUrlPage').': '.$this->Vc_TargetPage.'',-1); 106: msg($this->lang('SourcePageExist').' : <a href="'.wl($this->Vc_SourcePage).'">'.hsc($title).'</a>',-1);
Diff:
85c85 < msg($this->lang('SameSourceAndTargetAndPage').': '.$this->Vc_SourcePage.'',-1); --- > msg($this->lang['SameSourceAndTargetAndPage'].': '.$this->Vc_SourcePage.'',-1); 93c93 < msg($this->lang('NotInternalOrUrlPage').': '.$this->Vc_TargetPage.'',-1); --- > msg($this->lang['NotInternalOrUrlPage'].': '.$this->Vc_TargetPage.'',-1); 106c106 < msg($this->lang('SourcePageExist').' : <a href="'.wl($this->Vc_SourcePage).'">'.hsc($title).'</a>',-1); --- > msg($this->lang['SourcePageExist'].' : <a href="'.wl($this->Vc_SourcePage).'">'.hsc($title).'</a>',-1);
I'm trying to set up the 404manager plugin and after installing it (along with the note and pagemove plugins) it doesn't appear on the admin page. Could this be a conflict with the redirect plugin?
I'm using the 05-05-2008 version of dokuwiki. Upgrading at the moment is hard as I've personalised a lot of dokuwiki's config files, but if that's likely to be the problem then I'll do it
Merçi
The name in the admin menu is returned by the function getMenuText of the admin.php file in the plugin.
If the function don't find a translation, you normally must see the name of the plugin.
Problem solved. I just pressed the update button on the plugin management page. Don't understand what happened but the problem's solved. Thanks
There were apparently problems with implementing 404, both with this plugin and the core config option, with some users reporting that IE didn't get the edit page or the new page create dialogs properly. In testing with up-to-date versions of DokuWiki and IE this no longer seems to be an issue.