The RewriteHandler is inspired by the Apache's mod-rewrite. Aside from rewriting URI's it can do many things. See the rule list for more.
The Rule is divided in 3 types: PatternRule, RegexRule and others. Each rules have a specific actions. And these actions are only invoked whenever the rule find its match. Below are the list of rules with their corresponding actions.
This rule uses servlet-mapping syntax for pattern matching. Below are known subclasses of PatternRule.
Adds a new cookie in response.
Add/modifies the HTTP headers in response.
Sets the redirect location.
Sets the status and error codes.
Rewrites the requested URI.
This rule uses the regular expression syntax for pattern matching. Below are known subclasses of RegexRule.
Rewrites the requested URI using regular expression.
Disables the keep alive on SSL from IE5 or IE6.
The old version of rewrite.
Below is a sample how to configure the rewrite handler in jetty-rewrite.xml.
To use this configuration, include the configuration file during jetty startup. Example below.