Since Tomcat 8 a rewrite valve is available for usage. We should enable it by default and allow contributing new rules by leveraging our deployment preprocessor.
Ex:
deployment-fragment.xml
<?xml version="1.0"?> <fragment version="1"> <!-- JSF permalink redirect --> <extension target="rewrite#RULE"> RewriteRule ^/nxdoc/default/(.*)/view_documents /ui/#!/doc/$1 [NE,R] </extension> <!-- ES6 / ES5 code --> <extension target="rewrite#RULE"> RewriteCond %{HTTP_USER_AGENT} .*Chrome.* RewriteRule ^/shop/(.*) /shop/es6-bundled/$1 [L] RewriteRule ^/shop/(.*) /shop/es5-bundled/$1 [L] </extension> </fragment>