redirect plugin by Andreas Gohr
Redirects page accesses to other pages or external sites using a central configuration file.
Last updated on 2008-08-10. Provides Admin, Action.
Compatible with DokuWiki 2008-05-05 (maybe earlier).
Similar to 404manager.
Download and install the plugin using the Plugin Manager using the following URL. Refer to Plugins on how to install plugins manually.
The plugin stores a list of page/redirect pairs in a config file called redirect.conf in the plugin directory. This file needs to be writable by the webserver to edit it from the administration menu.
In order to implement the redirections, just place on the redirect.conf file lists of the old pages, followed by the new ones:
old_namespace:my_page new_namespace:my_page
On this example, when the users try to access old_namespace:my_page it will be redirected to new_namespace:my_page
Access to the configuration is granted for Managers and Superusers.
Is there any tech limit? What about 5000 pages being redirected to another page? Even if it's possible; will there be any down-performance consequence?
Mikhail
I've been trying to get this plugin to work for a while, I can get to the configuration page for it and it reports that it writes the file successfully, however:
So as far as I can tell, this plugin does nothing.
This plugin is installed and working just fine here at dokuwiki.org, so I can assure you that it works. Without you providing any detailed info on what you configured I can't tell what's going wrong at your side. — Andreas Gohr 2008/10/07 09:36
Okay, I have it working, using a web-install as opposed to a manual install got it going, however the links that redirect stay red, is there any way to get them to go green to tell a user that there is a page there? — Mordax Praetorian 2008/10/08 01:51BSTI have the same problem: redirected pages show their links in red instead of green. Is this a malfunction or it is not a feature of the plugin? — Dace 2008/11/05 12:54
One thing that had me stumped for about 10 minutes was the apparent lack of functionality in a perfectly legitimate redirect declaration - which led me to do some tinkering, whereby I discovered the following:
This will not work because of the / character
my_favorite_pictures/summer_vacation pictures_i_love/summer_vacation
But it works when you replace / with the : namespace separator
Notice, I've left the '/' intact with the second (redirected) URL. This will not prevent a redirect.
my_favorite_pictures:summer_vacation pictures_i_love/summer_vacation
And so will this
An even stricter adherence to the colon namespace separator.
my_favorite_pictures:summer_vacation pictures_i_love:summer_vacation
If the conf set like this:
oldname newname
when you place a oldname, the link becomes red that seems there is no content there, though clicking it the redirect works.
By default, the DokuWiki Index list only internal pages. But with this plugin, any page (static HTML, forum…) can be visible too ! So you get a real index of your website, not only the wiki. For those who uses DokuWiki as a CMS and don't know how to do server-side redirects, this is really great !
You just have to create the corresponding DokuWiki pages and make them redirect to the real URL. For example :
:forum http://www.mysite.com/forum/index.php :forum:latest-news http://www.mysite.com/forum/viewforum.php?f=81
Hi, I've IMO improved this very nice plugin a bit.
I can set minimum right in the config for each redirect which cause no redirect if you have this right.
Example:
redirect.conf
blog:test construct 4 blog:test2 construct
The first rule will redirect to the page construct as long as the user who calls blog:test doesn't has write permission for blog:test. If the user has write permission for this page he/she will see the page.
The second rule will always redirect to construct.
The number should be chosen according to the level shown here: http://www.dokuwiki.org/acl#background_info
I'm using this improvement together with the plugin underconstruction which allows me to easily set the permission for a page to none for everyone but me which cause that no one but me can see this page.
Here is the diff for action.php:
51c51,55
< header('Location: '.wl($redirects[$ID] ,'',true));
---
> $data = explode(' ', $redirects[$ID]);
> if ( auth_quickaclcheck($data[0]) < $data[1] || ! isset($data[1]) )
> header('Location: '.wl($data[0] ,'',true));
> else
> return;
— Andrwe 31-01-2010 19:10