Descriptor homepage does not work

Hi,

I configured the homepage into Global Administration - Wikis - Descriptor - Homepage.

If I click to the XWiki logo in the top left corner of the Wiki it works and I am redirected to the configured homepage (https://xwiki.my.domain/XWiki/Welcome), but if I go to XWiki at https://xwiki.my.domain I still see the default welcome page (“Welcome to your wiki” - “The basics”).

I configured short URLS using information from https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/ShortURLs/ with UrlRewriteFilter.

How could I solve and redirect https://xwiki.my.domain to https://xwiki.my.domain/XWiki/Welcome?

Thanks!

Hi, could you help me on this problem?
I think this could be a bug, could you help me please?
Thanks!

Hi, it’s unlikely that this is a bug. It’s more likely that you have some errors in your urlrewritefilter configuration. Without knowing more what you did it’s hard to help you.

I enabled UrlRewriteFilter as descripted at https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/ShortURLs/#HUrlRewriteFilter.

I added this into web.xml after <description>XWiki Application</description>:

  <!-- URL Rewrite Filters: http://www.tuckey.org/urlrewrite/ -->
  <filter>
    <filter-name>UrlRewriteFilter</filter-name>
    <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>UrlRewriteFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
  </filter-mapping>

Then I addedd a /var/lib/tomcat9/webapps/xwiki/WEB-INF/urlrewrite.xml file with the following code:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN"
        "http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
<urlrewrite decode-using="null">

  <rule>
    <note>
     Ensure that URLs ending with .gwtrpc are not modified.
     Note: Not needed with XWiki 9.7+ since the GWT editor has been removed.
    </note>
    <from>^/(.*)\.gwtrpc$</from>
    <to type="forward" last="true">-</to>
  </rule>

  <rule>
    <note>
      Ensure that URLs that must not be served by the Struts Servlet are not modified.
    </note>
    <from>^/((bin|resources|skins|asyncrenderer|rest|webdav|xmlrpc|wiki|webjars)/(.*)|robots\.txt)$</from>  
    <to type="forward" last="true">-</to>
  </rule>

  <rule>
    <note>
      For all other URLs we prepend the "/bin/" prefix so that they get routed to the XWiki Action Servlet.
    </note>
    <from>^/(.*)$</from>
    <to type="forward">/bin/$1</to>
  </rule>

  <outbound-rule>
    <note>
      Rewrite outbound URLs to remove the "/bin" part when there are two paths after it.
    </note>
    <from>/bin/(.*)/(.*)$</from>
    <to>/$1/$2</to>
  </outbound-rule>

  <outbound-rule>
    <note>
      Rewrite outbound URLs to remove the "/bin" part when there's a single path after it.
    </note>
    <from>/bin/(.*)$</from>
    <to>/$1</to>
  </outbound-rule>

  <outbound-rule>
    <note>
      Rewrite outbound URLs to remove the "/bin" part it's the last path.
    </note>
    <from>/bin$</from>
    <to>/</to>
  </outbound-rule>

</urlrewrite>

That’s all.

This seems to indicate that you deployed XWiki under the xwiki servlet context. So how do you rewrite from the ROOT context to the xwiki context?

I’m rewriting on Apache2 in the VirtualHost configuration:

# XWiki
<Location />
        ProxyPass http://127.0.0.1:8080/xwiki/
        ProxyPassReverse http://127.0.0.1:8080/xwiki/
        Require all granted
</Location>

I made this because I had some problems in moving XWiki from the xwiki to the ROOT context in Tomcat.