Another thing. As you are using Wildfly, the context.xml workaround won’t work for your. Wildfly is using Undertow as the Servlet container and the context.xml workaround works only on Tomcat. I’m not sure if there is a way to work around this problem in Undertow. Perhaps you should ask this question in the Wildfly/Undertow forums? Have a look at the Rewrite FAQ entry for this for more details on the issue.