Change the Wiki Path Segment
Steps
In a path-based URL such as /xwiki/wiki/support/view/Main/WebHome the wiki segment is the fixed marker that tells XWiki to read the wiki from the path, and renaming it means changing three files rather than one.
- Set the new segment in WEB-INF/xwiki.properties:
url.standard.multiwiki.wikiPathPrefix = site - Set the same value in WEB-INF/xwiki.cfg:
xwiki.virtual.usepath.servletpath=siteThe filter that rewrites form submissions reads this key and not the one above, so a page saved from a subwiki is sent to the wrong URL while only the first file is changed.
- Point the action servlet at the new segment in WEB-INF/web.xml, replacing the mapping that carries the old one:
<servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>/site/*</url-pattern> </servlet-mapping>The servlet container routes on this mapping alone, so without it every URL built with the new segment is answered with a 404.
- Replace the old segment in xwiki.authentication.logoutpage, further down WEB-INF/xwiki.cfg. The value is a pattern, and its third alternative is the path-based one:
xwiki.authentication.logoutpage=(/|/[^/]+/|/site/[^/]+/)logout/* - Restart XWiki. All three files are read once, at startup.
- Open a subwiki through the renamed segment and confirm that it answers, that its own links carry the new segment, and that logging out of it works:
http://myfarm.example.org/xwiki/site/support/view/Main/WebHome
FAQ
Does this rename the bin part of the URL as well?
No. That segment is a separate setting, url.standard.entityPathPrefix, and renaming it is not part of this procedure.
Can the segment be removed instead of renamed?
No. The segment is what marks a URL as path-based in the first place, as Wiki URL Resolution sets out.
Does an existing farm keep working on the old segment?
No. The servlet mapping is what routes the segment, and there is one of them, so the old addresses stop resolving as soon as the instance restarts.