The RewriteHandler is responsible for rewriting URI's of received requests. Each requests will go through to the list of rules you have specified either in configuration or pragmatically. If a rule finds a match with the requests, the rule will apply its action.
The Rule is divided in two types: PatternRule and RegexRule. Each rules have a specific actions. And these actions are only invoked whenever the rule find its match. Here are the list of rules and 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.
Below is a sample how to configure the rewrite handler in jetty.xml.