首页 > 解决方案 > 在 Wildfly 中配置standalone.xml 以将根(/)重定向到子目录

问题描述

如何将根路径重定向到子路径?

例如 http://test.com:9090/ -> http://test.com:9090/portal/

标签: wildfly-8

解决方案


在较新版本的 Wildfly 中,我们可以在 undertow 中使用 rewrite:

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

<rewrite name="root-redirect" redirect="true" target="/xxx" />

推荐阅读