| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 5 |
<meta http-equiv="Cache-Control" content="no-cache"> |
| 6 |
<title>RewriteHandler</title> |
| 7 |
</head> |
| 8 |
<body> |
| 9 |
<h1>Links to test the RewriteHandler</h1> |
| 10 |
<p>All examples below were configured using <tt>etc/jetty-rewrite.xml</tt>.</p> |
| 11 |
|
| 12 |
<h2>Internal URI rewrite</h2> |
| 13 |
<dl> |
| 14 |
<dt><a href="../some/old/context">Rewrite "../some/old/context" to "../rewritten/newcontext"</a></dt> |
| 15 |
<dd>This demo shows how the entire request URI can be internally rewritten to point to another context, using simple text matching</dd> |
| 16 |
|
| 17 |
<dt><a href="../rewrite/for/beginning">Rewrite "../rewrite/for/beginning" to "../rewritten/beginning"</a></dt> |
| 18 |
<dd>This demo shows how the beginning of the request URI can be rewritten, while keeping the ending section</dd> |
| 19 |
|
| 20 |
<dt><a href="../rewritten/reverse/bar/foo">Rewrite "bar/foo" to "foo/bar" using regex</a></dt> |
| 21 |
<dd>This demo shows how sections of the request URI can be rearranged. It uses regex to parse out each section, and then return them in reverse order</dd> |
| 22 |
|
| 23 |
<dt><a href="../rewrite/for/reverse/bar/foo">Rewrite the beginning, and reverse the path sections</a></dt> |
| 24 |
<dd>This demo shows how rewrite patterns can be chained.</dd> |
| 25 |
|
| 26 |
<dt><a href="../dump/reverse/bar/foo">Rewrite "bar/foo" to "foo/bar", full dump view</a></dt> |
| 27 |
<dd>This demo rewrites "bar/foo" to "foo/bar" the same as earlier, but shows a full dump of the request</dd> |
| 28 |
|
| 29 |
<h2>Redirect</h2> |
| 30 |
<dt><a href="../redirect/this">Redirect "../redirect/this" to "../redirected/this"</a></dt> |
| 31 |
<dd>This demo redirects the request in a manner visible to the user agent, instead of doing an internal rewrite.</dd> |
| 32 |
|
| 33 |
<h2>Cookie</h2> |
| 34 |
<dt>All pages</dt> |
| 35 |
<dd>This demo rule sets a "visited" cookie for each page you visit. The second time you go to any of the links above, you will see an additional line, "Previously visited: yes".</dd> |
| 36 |
|
| 37 |
<h2>Response Code</h2> |
| 38 |
<dt><a href="../400Error">Return a 400 error status</a></dt> |
| 39 |
<dd>This demo shows how to modify the response code of a page to an error, based on its URL</dd> |
| 40 |
|
| 41 |
</dl> |
| 42 |
</body> |
| 43 |
</html> |