When removing pages from your DokuWiki site, you will need to set up a redirect to prevent users from getting 404 not fopund errors. Sometimes when users bookmark pages or when Google caches a removed page people will get 404 not found pages. In order to redirect a page, you will need to use a plugin called “Page Redirect“. This article will explain how to install the “Page Redirect” plugin and how to set up a redirect to a page that was removed.
Installing the “Page Redirect” plugin
In order to make any redirects in DokuWiki, you will need to use the “Page Redirect Plugin“. This section will give you the steps on how to install the “Page Redirect Plugin.”
- Click the following link to get the plugin URL.
Right click the download link and copy the Link location. (You can also click the download link and get the url from the browser.)
The URL you get for the plugin should be the following:
- Log into DokuWiki.
Click the Admin link at the top.
In the Administration Click Plugin Manager.
In the “Download and install a new plugin” box, paste the url you obtained from the site in the text box.
The Plugin should show as “Successfully installed” and the Page Redirect plugin will be listed in the Installed plugins.
Now that the “Page Redirect” plugin was successfully installed, you can now proceed to the next section to learn how to redirect the pages in DokuWiki.
Redirecting a removed page
Redirecting pages in DokuWiki cannot be done without plugin code being inserted into the page that is being redirected. The following section will explain how to use the “Page Redirect” plugin code for redirecting a removed page to an existing page.
- Log into DokuWiki.
Click the recent changes link at the top right side of your DokuWiki..
On the Recent changes page, find the page you want to redirect. (In this case the “community_ideas” page will be redirected).
Click the page.
Select the Old Revisions link on the left that is the clock icon.
Find the removed page and select it.
On the right side, click the pencil to “Edit this page.”
Enter the following code in the page and save it.
The redirect code “namespace:page” is an example. You will need to change the namespace name (If there is one) and the page name for the redirect to go to the correct page. In this case the redirect is going to a main root page called “helping_community” so the code we are inserting in this example is the following.
Now when visiting my “Community ideas” page, the site is redirected to the “Helping the Community page“. You will see a “You were redirected here from community_ideas” in the page.