URL Configuration Properties
Reference
The configuration keys that decide which URLs XWiki accepts and which URLs it generates. The How-tos under Short URLs are what set them.
Two files are involved, and they do not do the same thing. The xwiki.cfg keys are what XWiki's URL factory reads when it generates a URL. The url.standard.* keys of xwiki.properties act on the way an incoming URL is read, when they are read at all, so none of them changes the URLs the wiki puts in its pages.
The comments shipped in the configuration file itself say otherwise, presenting two of these keys as replacements for their older counterparts, and a third key is read under the name of another. Both defects are tracked as XWIKI-25636.
| Property | File | Default | What it does |
|---|---|---|---|
| xwiki.webapppath | xwiki.cfg | taken from the request URL | The application name used in generated URLs. An empty value removes it. |
| xwiki.servletpath | xwiki.cfg | taken from the request URL | A hard override of the servlet mapping in generated URLs, written with a trailing slash and no leading one. A short-URL setup uses xwiki.defaultservletpath instead. |
| xwiki.defaultservletpath | xwiki.cfg | bin/ | The fallback servlet mapping, used when it cannot be determined from the request URL, which is the case behind a reverse proxy. An empty value drops bin from generated URLs. |
| url.standard.entityPathPrefix | xwiki.properties | bin | Nothing reads this key, so setting it changes no URL at all. The prefix XWiki recognises as introducing an entity path is taken from url.standard.multiwiki.wikiPathPrefix instead, falling back to xwiki.defaultservletpath, which is why the default still works. |
| xwiki.showviewaction | xwiki.cfg | 1 | Whether the view action appears in generated URLs. Set it to 0 to omit it. |
| url.standard.hideViewAction | xwiki.properties | false | Declared in xwiki.properties as the replacement for xwiki.showviewaction, but no code reads its value, so setting it has no effect. |
| url.standard.multiwiki.wikiPathPrefix | xwiki.properties | wiki | The path segment that precedes the name of a path-based subwiki in the URLs XWiki accepts. Changing it means changing the matching action servlet mapping in web.xml too, and the page URLs XWiki generates keep wiki/ whatever its value. It also sets the entity path prefix that the key above is named for, so giving it any other value stops bin from being recognised and every page URL answers 404. |
FAQ
Which value wins if I set both keys of a pair?
The xwiki.cfg one, in both of the pairs above. The intended design is the opposite for an incoming URL, the xwiki.properties key winning with the xwiki.cfg value as its default, but neither url.standard. key of the table takes effect, so what the instance obeys is xwiki.showviewaction and xwiki.defaultservletpath. For the URLs XWiki generates, the xwiki.cfg key is the only one consulted in every case.
Is there an xwiki.properties key for the application name?
No. xwiki.webapppath exists only in xwiki.cfg.