How to change the home page destination?

Version 18.2 by Gunter Ohrner on 2019/06/26

Before XWiki 6.4RC1, this was not possible and modifying the content of the home page (i.e. Main.WebHome) was the only solution to work around this limitation.

Since 6.4RC1

Go to the wiki's Administration > Wikis > Descriptor section and set the Homepage field with the location of the page you want to use as homepage for your wiki.

Workarounds for older versions

You have several options:

  • Option 1: Simply edit Main.WebHome using the wiki editor or the WYSIWYG editor and replace the content by your content
  • Option 2: Include the page you wish to display from the home page, e.g. have the following in Main.WebHome:
    {{include reference="MySpace.MyPage"/}}
  • Option 3: Redirect the home page to your page, using a script, e.g. have the following in Main.WebHome:
    {{velocity}}
    $response.sendRedirect($xwiki.getURL('MySpace.MYPage'))
    {{/velocity}}
     (See instructions on how to alter / remove the redirect again in case your default editor is the WYSIWYG editor.)
  • Option 4: Modify the web.xml file to control what http://<yourserver>/ should redirect to. Specifically, edit WEB-INF/web.xml, locate the section with the servlet responsible for the redirect (the one with the line <servlet-class>com.xpn.xwiki.web.HomePageRedirectServlet</servlet-class>, and change that section to contain something like:
    <servlet>
     <servlet-name>redirectHomeServlet</servlet-name>
     <servlet-class>com.xpn.xwiki.web.HomePageRedirectServlet</servlet-class>
     <init-param>
       <param-name>homePage</param-name>
       <param-value>bin/MySpace/MyPage</param-value>
     </init-param>
    </servlet>
  • Option 5: (only if your version has the Dashboard displayed on the home page) Keep the dashboard but change the displayed widgets. To do so go to Dashboard.WebHome and edit in inline mode. You can also edit the home page and click the included page in the panel on the right to navigate to Dashboard.WebHome
Tags: redirect
   

Get Connected