How to move or relocate a Context.
The MovedContextHandler may be used to relocate or redirect a context
that has changed context path and/or virtual hosts.
The sample context configuration below redirects the /jetty context to / with a permanent redirection, while preserving pathinfo and query strings:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.handler.MovedContextHandler">
<Set name="contextPath">/jetty</Set>
<Set name="newContextURL">/</Set>
<Set name="permanent">false</Set>
<Set name="discardPathInfo">false</Set>
<Set name="discardQuery">false</Set>
<Set name="virtualHosts">
<Array type="String">
<Item>209.235.245.73</Item>
<Item>127.0.0.73</Item>
<Item>mortbay.org</Item>
<Item>www.mortbay.org</Item>
<Item>jetty.mortbay.org</Item>
<Item>jetty.mortbay.com</Item>
</Array>
</Set>
</Configure>
[!Jetty:FAQ^info_sm.gif!]
[Back to FAQ]