Published

Say that a wiki's Homepage descriptor field does not change the wiki's root URL

Last modified by Eleni Cojocariu on 2026/11/03 18:00

Both pages document the wiki descriptor's Homepage field without saying what it does not do, and that omission is what sends administrators to web.xml without understanding why it is needed.

What the descriptor field really drives. Setting Wikis > Descriptor > Homepage writes WikiDescriptor.mainPageReference, and every link built from a bare wiki reference honours it: the logo (companylogo.vm uses $services.wiki.currentWikiDescriptor.mainPageReference), the home icon of the breadcrumb (hierarchy_macros.vm hands a WIKI reference to $xwiki.getURL, which resolves it through AbstractCurrentGetReferenceResolver to the descriptor's main page), the document tree root and the /wikimanager REST home href. Those are exactly the two effects the Wiki Application page already lists, and they need no configuration change at all.

What it does not drive. The wiki's root URL never reaches that code. /xwiki/ hits the redirect welcome-file, which is HomePageRedirectServlet, whose target is hardcoded to bin/view/Main/ and is wiki-unaware; the only override is the homePage init parameter of the redirectHomeServlet servlet in WEB-INF/web.xml. A URL that names no page (bin/view/ with nothing after it) is not descriptor-driven either: the blanks are filled in by the default entity resolver, from xwiki.defaultweb and xwiki.defaultpage.

That value is instance-wide, so on a farm it cannot differ per subwiki — worth stating, because the descriptor field is per wiki and the natural assumption is that its override is too.

This is XWIKI-12499, still open. XWIKI-13995 (the same report, with these exact steps to reproduce) and XWIKI-23779 ("Change of start page not working") were both closed as duplicates of it, so the gap is hit repeatedly and read as a bug in the field rather than as undocumented behaviour.

The two changes

  • Extension.Wiki Application, "Configure Wiki" — a warning right after the two existing bullets, the web.xml snippet that changes the root URL, the note about the root-context deployment going through XWikiRootServlet first, the instance-wide caveat, and a pointer at XWIKI-12499. Only the description xproperty is posted; every other field and xobject is left exactly as it is.
  • Extension.Wiki Manager Application EditWikiDescriptor, "Home page" — one paragraph naming what the field drives (the logo and the breadcrumb home icon) and what it does not, pointing at the section above.

Nothing existing is removed or reworded, and no URL is written inside a monospace span: on this wiki a URL written that way is auto-linked and swallows the closing delimiter, so the two example URLs use an inline code macro instead.

All changes

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.Admin
1 +xwiki:XWiki.elenicojocariu
ExtensionCode.ExtensionClass[0]
Description
... ... @@ -129,6 +129,28 @@
129 129  * When clicking on the logo, you'll be redirected to the new home page
130 130  * When clicking the home icon in the breadcrumb, you'll be redirected to the new home page
131 131  
132 +{{warning}}
133 +Changing the home page does **not** change the page the wiki's root URL leads to: browsing to {{code language="none"}}http://server/xwiki/{{/code}} still lands on ##Main.WebHome##. That redirection is performed by a servlet declared in ##WEB-INF/web.xml##, before XWiki resolves the wiki descriptor, and the same goes for a URL that names no page, such as {{code language="none"}}http://server/xwiki/bin/view/{{/code}}.
134 +{{/warning}}
135 +
136 +To change where the root URL leads, uncomment the ##homePage## init parameter of the ##redirectHomeServlet## servlet in the ##WEB-INF/web.xml## file of the XWiki web application, set it to the page you want and restart:
137 +
138 +{{code language="xml"}}
139 +<servlet>
140 + <servlet-name>redirectHomeServlet</servlet-name>
141 + <servlet-class>com.xpn.xwiki.web.HomePageRedirectServlet</servlet-class>
142 + <init-param>
143 + <description>The address to redirect to when the client hits the root of the application.</description>
144 + <param-name>homePage</param-name>
145 + <param-value>bin/view/Sandbox/</param-value>
146 + </init-param>
147 +</servlet>
148 +{{/code}}
149 +
150 +The value must not start with a ##/##, so that the name of the web application context stays changeable. When XWiki is deployed in the root context of the servlet container, the request goes through the ##XWikiRootServlet## servlet of the root web application first, whose ##redirectoTo## init parameter is set the same way.
151 +
152 +This is a single instance-wide value, so it cannot be set per wiki: on a farm, the root URL of every wiki leads to the same path. See [[XWIKI-12499>>https://jira.xwiki.org/browse/XWIKI-12499]].
153 +
132 132  {{image reference="wikiDescriptorEditingAdministration-cropped.png"/}}
133 133  
134 134  == Delete a Wiki ==

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.ThomasMortagne
1 +xwiki:XWiki.elenicojocariu
Content
... ... @@ -36,4 +36,6 @@
36 36  
37 37  The page in the wiki used to generate the URL associated with the alias. You can get it using the wiki alias method ##getWikiUrl()##.
38 38  
39 +This is the page the wiki's logo and the home icon of the breadcrumb link to. It does **not** change the page the wiki's root URL ({{code language="none"}}http://server/xwiki/{{/code}}) leads to: that redirection is configured in the ##WEB-INF/web.xml## file of the XWiki web application and is the same for every wiki of the instance. See the "Configure Wiki" section of the [[Wiki Application>>Wiki Application]] documentation.
40 +
39 39  {{code}}$xwiki.wikimanager.getWikiDocument("manager").getWikiUrl(){{/code}}
Nov 3, 2026, 6:00:18 PM

Approved by Eleni Cojocariu

Approvers

Approvers have not been explicitly defined for this Change Request. Approvers will be based entirely on approval rights.

Get Connected