]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/plugins/contrib/redirect.mdwn
Update URL of a website (using ikiwiki)
[git.ikiwiki.info.git] / doc / plugins / contrib / redirect.mdwn
1 [[!meta author="spalax"]]
2 [[!template id=plugin name=redirect author="[[Louis|spalax]]"]]
4 This plugin provides a [[ikiwiki/directive/redirect]] [[ikiwiki/directive]].
6 Using this, you can cause a page to redirect to another page (something similar to the ``redir`` option of the [[meta|http://ikiwiki.info/ikiwiki/directive/meta]] plugin.
8 [[!toc]]
10 # Directive
12 It accepts options ``pages``, ``skip``, ``sort``, ``reverse``, which have the same meaning as they have in the [[inline|http://ikiwiki.info/ikiwiki/directive/inline/]] directive. It builds a list of pages using those arguments, and redirect the page to the first page of this list.
14 It also renders a text *If you are not redirected automatically, follow \[[this link]].* This text can be customized by changing the template `redirect.tmpl`, which accepts a single variable ``TARGETPAGE``.
16 # Example
18 To have a page ``latest.html`` redirect to your latest blog post, have the following line into ``latest.mdwn``:
20     \[[!redirect pages="blog/* and !blog/*"]]
22 # Setup
24 This directive accepts no setup options.
26 # Differences with the ``meta`` plugin
28 * This directive is better than the ``redir`` option of the [[meta|http://ikiwiki.info/ikiwiki/directive/meta/]] plugin because it can redirect to (the first page of) a pagespec, meaning things like *"redirect to my latest blog post"*.
29 * The ``redir`` option of the [[meta|http://ikiwiki.info/ikiwiki/directive/meta]] plugin is better than this directive because:
30   * it can redirect to an anchor ``\[[!meta redir="foo#bar"]]``;
31   * it can redirect to an external page ``\[[!meta redir="http://example.com"]]``.
33 # Download and install
35 Code and documentation can be found here : [[https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/Redirect]].