Search code examples
wildfly-8

Configuring standalone.xml in Wildfly for redirect root(/) to sub directory


How to redirect root path to subpath?

e.g. http://test.com:9090/ -> http://test.com:9090/portal/


Solution

  • In the newer version Wildfly, we can used rewrite in undertow:

    <filter-ref name="root-redirect" predicate='regex(pattern="^/$", value="%U", full-match=true)' />
    
    <rewrite name="root-redirect" redirect="true" target="/xxx" />