DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:simpleforward

SimpleForward Plugin

Compatible with DokuWiki

2014-09-29

plugin Forwards non-existent pages to another local website.

Last updated on
2014-10-14
Provides
Action
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to whennotfound

Tagged with 404, redirect

This plugin forwards all requests to non-existent Dokuwiki pages to an underlying website. Motivation for this is gradual transition of the website from original application to Dokuwiki.

Installation

Plugin is by default disabled so installation should be without any problems.

Before enabling the plugin be sure you have correctly set path to the underlying website.

:!: If your underlying website uses some redirections via .htaccess you have to port these redirections to Dokuwiki's .htaccess.

Usage

If you need to access Dokuwiki, add following GET parameters:

  • dokuwiki_simpleforward=0,
  • (do=edit when you need to create the page).

This would temporarily disable the plugin and you can e.g. create the Dokuwiki page.

Example

example.net/bigpage/subpage/subsubpage?dokuwiki_simpleforward=0&do=edit

will enable you to create subsubpage.

Configuration and Settings

hh lohmann 2014-11-14 17:00: being not sure if I understand the plugin's whole story the following makes it work:

  • Section Simpleforward in the Config Manager:
    • plugin simpleforward document root ⇒ the filesystem root directory for the site to use:
      • e.g.: /my_path/htdocs/
      • you may leave the final /, but it has to be a directory
    • plugin simpleforward enabled
      • (self explaining)
    • plugin simpleforward index ⇒ the filesystem file (with possible path) to serve “file not found”:
      • relative to the above given simpleforward document root
      • e.g.: errMessages/myPersonal404.FILE_EXTENSION
        • with FILE_EXTENSION = php the file will be handed over to PHP, with any other extension simpleforward directly outputs its content - this is important for the “DokuWiki page” usage as stated next
  • Example: forwarding any “file not found” to your DokuWiki start page:
    • plugin simpleforward document root: /my_path/doku/
    • plugin simpleforward enabled: (checked)
    • plugin simpleforward index: doku.php
  • Answering with a specially tailored DokuWiki page to serve for “file not found”, allowing editing and access rights by DokuWiki (i.e. as esp. editors are used to)
    • Since plugin simpleforward index must be file in the filesystem you cannot use a DokuWiki page call like “doku.php?id=errMessages/myPersonal404”, but you can achieve something nearly equivalent by setting plugin simpleforward document root to your DokuWiki filesystem root and one of the following:
      • Set plugin simpleforward index to doku.php and add / edit some simpleforward mechanismn in your “:start” page with DokuWiki
      • Set plugin simpleforward index to a filesystem file corresponding to a DokuWiki page and edit it with DokuWiki, e.g. setting like data/pages/errMessages/myPersonal404.txt and editing doku.php?id=errMessages:myPersonal404. Note that you cannot use any DokuWiki markup or plugins etc.1) in “myPersonal404” that way, but you have full HTML power (including client side means like Javascript) to create some information and do further (more sophisticated) forwarding, for instance something like2)
        <h1>Page not found</h1>
        <script type="text/javascript">
          document.write ( ''
            +'<p><i>'
            + document.location.search.split('?id=')[1]
            + '</i> does not lead to an existing page.'
            + '</p>'
          );
        </script>
        <p>Do you want to go to the <a href="/doku/doku.php">Start Page</a>?</p>
  • :!: Be aware: If you have activated simpleforward successfully (i.e. with valid “document root” and “index”) you MUST provide something on your defined “index” to allow for “simpleforward exceptions” so that you are able to create new DokuWiki pages (incorporating e.g. “&do=edit&dokuwiki_simpleforward=0”, see above)
1)
and no PHP, of course
2)
this is meant as a short example, not as an HTML tutorial, i.e. don't blame rough coding
plugin/simpleforward.txt · Last modified: 2024-08-31 07:19 by asacan

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki