Tomcat
URL rewriting instructions for Tomcat
Using rewrite Valve
Tomcat 8 can be configured using RewriteValve
. See http://tonyjunkes.com/blog/a-brief-look-at-the-rewrite-valve-in-tomcat-8/ for examples.
Instructions for UrlRewriteFilter
UrlRewriteFilter (commonly referred to as Tuckey) is a Java web filter for compliant web application servers such as Tomcat, Jetty, Resin and JBoss. Unfortunately UrlRewriteFilter depends on XML with its extremely strict syntax.
First follow the (install instructions on the UrlRewriteFilter website).
Append the servlet-mapping markup to the end of the
<filter mapping>
element in yourWEB-INF/web.xml
Add the pretty urls rule markup to the
<urlrewrite>
element to yourWEB-INF/urlrewrite.xml
configuration.Restart the web application server.
Servlet-Mapping markup
Example markup with UrlRewriteFilter and Wheels pretty URLs for WEB-INF/web.xml
.
Pretty URLs Rule markup
A complete barebones WEB-INF/urlrewrite.xml
configuration example with pretty URLs.
Last updated