[feature request] automatic redirection
Hi.
I've been thinking of this feature a few times so, it needs to be shared here.
When moving a page (or a few pages), it would be really handy that the plugin adds an automatic redirection (into the .htaccess maybe?).
Hope that this will retain your attention.
I wonder if this could be added as a plugin to the plugin.
I would also be interested in this feature. A significant portion of the content on the wiki I administer is added by users who are migrating it from other deprecated sources (e.g. an old intranet page); however, the namespace /pagename chosen by users does not always match the wiki guidelines, so I move pages fairly often, but then I have to manually ensure that users who have bookmarked the URL of the original non-wiki page (where the content was migrated from) will not get lost when landing on the wiki.
I love the idea of an optional "This page has moved to <new URL>" and/or an automatic redirect. However, I'm not sure I like the idea of .htaccess modification:
- Programmatic modification of .htaccess would have to do a very good job of understanding how .htaccess works, or it might break some people's [custom] .htaccess some of the time.
- After lots of moves, either the root .htaccess would get very complex, or there would be lots of individual .htaccess - all different from one another - scattered through subdirectories. I think this could be hard to debug for a wiki admin without CLI access.
- Seems like using a sledgehammer to crack a nut.
An alternative: PHP could return a 301 Permanently Moved redirect. I've used MediaWiki a bit - in fact, I tried MediaWiki before abandoning it for Dokuwiki - and the way MediaWiki handles this scenario seems to me to work well.
It should only be an Option IMHO, otherwise it will clutter htaccess
A follow-up of "also insterested"/"also hope to see this feature".
I think the MediaWiki way of moving+redirecting is feasible.
I am also interested in this feature.
There is the redirect plugin. Could we not have move hook into that? https://www.dokuwiki.org/plugin:redirect
There is the redirect plugin. Could we not have move hook into that? https://www.dokuwiki.org/plugin:redirect
A "redirect table" has to be manually built and maintained, to let DokuWiki know the rules of redirection. This is how plugin:redirect works.
It may be great if the rules are recorded at the same time when pages are moved by plugin:move...
OK, just read the code of the redirect plugin, and it does not have a api at all to add a redirect. It just loads or saves the whole redirects file as a blob. So a proper first step might be to add the feature to that plugin to be able to add redirects line by line. Otherwise, we could just try to append a line to DOKU_CONF . '/redirect.conf';
Thanks for bringing this up!
I was looking for automatic redirects, too, so that old URLs keep working when we change our wiki structure.
Adding a line to the redirect.conf file for now seems like a good solution indeed.
As a workaround, I just re-create the moved page and add a link to the new location. Would sure be great if this feature was implemented though. Seems there are already some ideas on how to do this posted here. 😓
For those of us who use the Redirect plugin, a simple #REDIRECT {newpagename} would do...
For those of us who use the
Redirectplugin, a simple#REDIRECT {newpagename}would do...
@saschaleib Thanks for sharing this info. For this inline usage/syntax, it's plugin:pageredirect [DokuWiki] to be used.
And there is plugin:redirect [DokuWiki], with which we have to write the redirect pairs in a centralized file, so it was not as convenient.