Redirect: To

By ErichSteinboeckErichSteinboeck

Description

Post Redirect info from Feb 2009 asks: “Wikimedia pages that are redirected to, show text "(Redirected from <pagename)", with a link so tht you can see the redirected page. Can the same be done here?”

In action

This page has been redirected from code:redirect-from-2nd

Here is an answer involving:

  • the landing page code:redirect-to (edit it) which shows a “This page has been redirected from …” message only if having been redirected from one of the two redirection pages below
  • a redirection page code:redirect-from (edit it): redirects to “redirect-to” showing an appropriate message there
  • another redirection page code:redirect-from-2nd (edit it): also redirects to “redirect-to” showing an appropriate message there
This is the Redirect module that redirects the browser directly to the "http://snippets.wikidot.com/code:redirect-to/noredirect/true/tag/_(none)/" page.

Code

How the Landing Page is Coded

[[module ListPages category="code" limit="1" tag="@URL"]]
[[size smaller]]
This page has been redirected from [[[%%page_unix_name%%|%%page_unix_name%%]]]
[[/size]]
[[/module]]

[[div style="display : none"]]
[[module Redirect destination="http://snippets.wikidot.com/code:redirect-to/noredirect/true/tag/_(none)/"]]
[[/div]]

How a Redirection Page is Coded

Any redirection page must be uniquely tagged with the tag specified in below [[module Redirect ...]] call — in this case “_code:redirect-from”

[[module Redirect destination="http://snippets.wikidot.com/code:redirect-to/tag/_code:redirect-from/"]]
[[/module]]

[[div style="display : none"]]
[[module Redirect destination="http://snippets.wikidot.com/code:redirect-to/noredirect/true/tag/_(none)/"]]
[[/div]]

Thanks to tsangk for this great snippet: conditional-blocks


text above inserted with:

[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]



Other snippets posted by ErichSteinboeck

TOC's from many pages - 16 Feb 2012 01:47
Module Listpages Tags - 16 Feb 2012 01:24
Module Feed Drilldown: Details Page - 16 Feb 2012 01:24
Module Feed Drilldown - 16 Feb 2012 01:24
Module Feed: Collapsible - 16 Feb 2012 01:23
Module Categories - 16 Feb 2012 01:23
MiniRecentPosts With Limit - 16 Feb 2012 01:23
ListPages: Horizontal? - 16 Feb 2012 01:20
Choose A Page! - 15 Feb 2012 00:32
Redirect: From (1st) - 01 Mar 2009 18:18
Redirect: From (2nd) - 01 Mar 2009 18:17


Rate this solution

If you think this solution is useful — rate it up!

rating: +3+x
Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License