Tags:
create new tag
, view all tags

Question

I'd like to have seamless (or relatively seamless) redirection in my Wiki: If someone clicks on a link to topic Foo it automatically redirects to Bar instead. A message that they've been redirected would be nice, but is not required.

The docs seem to imply that this can be done (I think; see http://twiki.org/cgi-bin/view/TWiki/TWikiDocumentation#Redirecting_from_an_Old_Topic), but that part of the docs is somewhat terse and I can't figure out 1) what to really do, or 2) if doing it would even solve this issue because a related doc page (http://twiki.org/cgi-bin/view/TWiki/TWikiMetaData#META_TOPICMOVED) seems to indicate that the first one isn't about auto redirection, but just keeps a meta link back to the previous topic for renamed topics.

Auto redirecting would be very cool. An example can be seen at Wikipedia:PalmPilot. Thanks!

Environment

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Linux 2.4.20
Web server: Apache/1.3.27
Perl version: perl, v5.6.1 built for i386-linux
Client OS: Windows 2000
Web Browser: Mozilla 1.3

-- AnthonyRThompson - 21 Aug 2003

Answer

This is really cool! Is it possible by editing metadata to create redirect? How exactly I need to edit matadata?

On second reading, IIUC, it says I need to place this fancy SEACH in old page, so it will generate hyperlink to new page. Fancy, but when editing the page, I can as well just type name of the new page - and it will be faster, without search.

BTW KwikiWiki has real redirect, when you type name of the other page in special syntax, and Kwiki will generate redirection header instead of page.

-- PeterMasiar - 21 Aug 2003

This wouldn't be too hard to do - just a matter of some new syntax, e.g. %REDIRECT{"dest"}% where dest is a URL or a WikiWord. The details of the implementation can be hard to get right - best to do both an HTTP header redirect and a page with redirection.

The TWiki code has redirection logic already, which would be worth investigating (e.g. CVS:bin/save redirects after saving the page, and there's a redirect function in CVS:lib/TWiki.pm as well). There should probably be a new template for the redirect page.

It would be very nice to have 'create redirect page' as an option when renaming pages, so that links to the old name work.

Patches welcome, have a look at PatchGuidelines.

-- RichardDonkin - 10 Sep 2003

You should checkout RedirectPlugin.

-- FrancisLiu - 15 Sep 2003

That did the trick beautifully--thanks Francis! To the creator(s) of the TWiki plugin architecture: nice work!

-- AnthonyRThompson - 23 Sep 2003

Topic revision: r5 - 2003-09-23 - AnthonyRThompson
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.