Wiki source code of Access a wiki

Version 3.7 by Manuel Smeria on 2012/12/13

Hide last authors
Sorin Burjan 3.3 1 By default when you connect to your wiki farm you will go to the main wiki. To be able to access other wikis, XWiki supports two modes.
Thomas Mortagne 1.1 2
3 {{toc/}}
4
5 = The domain name based wiki access =
6
Sorin Burjan 3.4 7 {{info}}
Sorin Burjan 3.5 8 This was the default mode until XWiki 3.3 RC1. After the release of XWiki Enterprise 3.3 RC1, the URL path based access mode is used as default.
Sorin Burjan 3.4 9 {{/info}}
10
Manuel Smeria 3.6 11 By default this mode is disabled. To enable it, go to ##xwiki.cfg## and set //xwiki.virtual.usepath// to 0.
Sorin Burjan 3.4 12
Thomas Mortagne 1.1 13 In virtual mode you can access any wiki by the [[domain name/alias>>http://en.wikipedia.org/wiki/Domain_Name_System]] registered in its descriptor with the field ##server## ("Alias" in the UI).
14
Manuel Smeria 3.7 15 For example if the url is //{{{http://wikiname.xwiki.org/xwiki/bin/view/Space/Page}}}// XWiki will try to find "wikiname.xwiki.org" as a value of the ##server## field in the objects of class ##XWiki.XWikiServerClass##. Then it extracts the last part of the page name to get the wiki identifier: in this case it finds ##XWiki.XWikiServerWikiname## and extracts "wikiname" as the wiki identifier to set the database to query on.
Thomas Mortagne 1.1 16
17 If no descriptor can be found:
18
19 * if the host is an IP (127.0.0.1, 85.65.12.36, etc.) XWiki selects the main wiki
20 * else, if the first part of the host name (what is before the first point) is "www" XWiki selects the main wiki
Manuel Smeria 3.6 21 * else, if the first part of the host name matches a wiki identifier XWiki selects that wiki
Thomas Mortagne 1.1 22
Manuel Smeria 3.6 23 If after all no wiki has been found, then XWiki redirects to the URL configured in the property ##xwiki.virtual.redirect## of ##xwiki.cfg##.
Thomas Mortagne 1.1 24
Manuel Smeria 3.6 25 So to be able to access your wiki you need to configure your DNS or modify hosts file in your operating system (see [[Hosts file documentation on Wikipedia>>http://en.wikipedia.org/wiki/Hosts_file]] for details).
Thomas Mortagne 1.1 26
27 = The URL path based wiki access =
28
29 {{info}}
Manuel Smeria 3.6 30 * This mode is supported only since XWiki Platform 1.7 and XWiki Enterprise Manager 1.5 and only when enabled.
31 * Starting with XWiki 3.3 RC1, this is the default mode.
Thomas Mortagne 1.1 32 {{/info}}
33
Manuel Smeria 3.6 34 When this mode is enabled you can access a wiki using an url like: {{{http://host/xwiki/wiki/wikialias/view/Space/Page}}}.
35 The two parts of ##/wiki/wikialias## mean:
Thomas Mortagne 1.1 36
Manuel Smeria 3.6 37 * ##wiki##: this is used by XWiki to identify the URL as a URL path based multiwiki access. You can configure it in ##xwiki.cfg## with the property ##xwiki.virtual.usepath.servletpath##.
38 (((
Sorin Burjan 3.4 39 {{warning}}
Manuel Smeria 3.6 40 Don't forget to set the ##xwiki.authentication.logoutpage## property accordingly. Change the "wiki" part in the property value for the right alias.
Sorin Burjan 3.4 41 {{/warning}}
Thomas Mortagne 1.1 42 )))
Manuel Smeria 3.6 43 * ##wikialias##: this is used by XWiki to find the wiki descriptor
Thomas Mortagne 1.1 44 ** first it tries to match ##wikialias## with the descriptors
Manuel Smeria 3.6 45 ** if it can't find the descriptor this way it tries to match the wiki descriptor using ##wikialias## as the wiki identifier. This means looking whether the ##XWiki.XWikiServerWikialias## document exists and contains an object of the ##XWiki.XWikiServerClass## class

Get Connected