Wiki source code of URL Mapping

Last modified by Raphaël Jakse on 2026/03/24 13:00

Show last authors
1 URL Mapping is a framework to handle requests from configured prefixes. The initial motivation behind this extension is that some people migrate to XWiki from another wiki solution (for example Confluence, for which [[we have a extension>>doc:documentation.extensions.admin.confluence.url-mapping.WebHome]]) or from a CMS and want their old links to still work (because [[Cool URIs don’t change>>https://www.w3.org/Provider/Style/URI]]). Visitors could have mails linking to the old website, or could have bookmark.
2
3 The URL Mapping extension provides a convenient way for developers to implement such redirections, and provides a convenient way for administrators to configure such implementations.
4
5 For instance, figure a wiki freshly migrated from Confluence. Many visitors of this wiki still have Confluence links to documents in their history, bookmarks or mails, but after the migration, the documents have of course moved and are accessed through URLs shaped by XWiki instead of URL shaped by Confluence. The URL Mapping extension makes it possible to:
6
7 * for a developer to write a set of URL mappers which will recognize URLs that look like ##/display/SPACE/Page title##, ##/spaces/SPACE/pages/NNN/Page title## and ##download/attachments/NNN/filename.ext## and redirect to the right document or attachment;
8 * for an administrator to configure a prefix where these URLs will be expected, so a reverse proxy can direct these old URLs to this prefix without risking to clash with XWiki URLs.
9 * for an administrator to configure a redirection screen that automatically redirects after a specified delay and that tells users to update their bookmarks… or, on the contrary, to let the redirects be transparent and immediate

Get Connected