Summary: create short urls for redirects using mapping similar to intermap
Version: 2008-07-11
Prerequisites: PmWiki 2.1
Status: stable
Maintainer: HansB

Questions answered by this recipe

How can I create short urls similar to urls, but under my control?
I want short urls to email confidential links on my restricted wiki.


This recipe lets you create short url aliases, both for wiki page and http: links.


Download redirectmap.phpΔ, copy to cookbook/ folder and include in config.php



Create a redirect map file local/redirectmap.txt or wiki page Site.RedirectMap and add entries similar to intermap like

 abcd: SomeVeryLongGroupName.SomeEvenLongerComplicatedPageName 

Then having your url shortcuts defined, you can use them in emails or other places as urls like

or on wiki pages like

[[{$FullName}?goto=abcd| abcd]]

The recipe script checks input for a 'goto' parameter, then checks the redirectmap files or page to see if there is a match, and if it finds a match, activates a redirect to the mapped url.

Note the script redirects, so the user will not see the shortcut url.


The script is adapted from the intermap routine in pmwiki.php.

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

See Also



Very nice recipe. Thank you. -Ian MacGregor

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.