It's a bit more verbose, but... over on Idea Redirect Without Java Script I added [{SET alias='IdeaRedirectWithoutJavaScriptByUsingAlias'}]

Get it?

Here's the original idea (by using InsertPage)...

TitleRedirect Without JavaScript
Date28-Jun-2005 02:05:32 EEST
JSPWiki version2.2.27
Idea CategoryPluginIdea
Idea StatusNewIdea

I was a bit surprised to see that JSPWiki does not have a 'native' redirect feature. I'm used to using this to redirect synonyms to a given wiki page. The currently-available solution is a plugin that relies on JavaScript to function, which means that it's reliant on the user having JavaScript turned on. It'd be nice to have a simple redirect facility that worked as a plugin, with syntax something akin to:

   [{Redirect Main}]

It would be great to have this work with InterWiki links, but not a necessity. But as it is, in browsers that have JavaScript turned off (and since this is a security risk, there are places where it is mandatory to have it off), this would provide a reliable redirect feature.

(End of InsertPage)

MurrayAltheim: Yeah, actually that works fine. The only downside is the syntax, which for non-techies might still be a bit much. And also, one of the nice things about some of the redirect features (e.g., PmWiki's) is that if you actually traverse a redirection, it puts a small message like "redirected from '<pagename>'" at the top of the page so that the user knows they've been redirected. Not knowing is either a bug or a feature, can't tell which. :-) But thanks much for the suggestion. I may try to write a PageFilter or something to simplify the syntax a bit, as my users are non-techies.

You can, since 2.2.x, use

[{SET redirect=''}]

or to set page aliases:

[{SET alias='FoobarPage'}]

-- JanneJalkanen

I tried the alias version and in principal it works. However, since the page is immediately forwarded, it is a very dangerous option. Once set, it is impossible to do anything with that page ever more, especially it is impossible to remove or change the alias!

I would envision a message displayed at top: "Forwarded from RedirectedPage", where clicking on the link behind RedirectedPage opens RedirectedPage in edit mode.

Also it would be very desirable to make alias recognize interwiki links. Currently [{SET alias='JSPWiki:Main'}] tries to open a page with a colon as part of the name, i.e. ".../Wiki/JSPWiki%3AMain"

-- Gregor Hagedorn, 2005-10-18

It's not impossible - you just need to write the edit URL by hand. Having a "redirected from" might be a good idea, yes.

Good point about InterWiki.

-- JanneJalkanen

I can confirm that the URL-manipulation works, I had not thought of it. Another more integrated and obvious way would be desirable though.

However, while trying to use the feature to build a glossary with many non-terminal-s-plural forms, it turned out that another problem is lurking: If the capitalization of the value for alias is not EXACTLY as JSPWiki expects, very strange things happen. The page is found, but with a another spelling, and worse, the lowercase-page name seems to be added to the JSPWiki link reference manager, so that alphabetical browsing (next/previous page) breaks. Or perhaps the page name is searched at the wrong position, could be. See IdeaRedirectWithoutJSAliasTest which does a redirect to "Main", but written lower case as "main". Watch the URL, which changes.

I believe it would be healthy if the content of alias would not be taken literally, but interpreted as another form of a wiki link (like those in brackets), with all the normalization routines executed.

-- Gregor Hagedorn, 2005-12-19

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-14) was last changed on 19-Dec-2005 21:49 by