You can do this:
If your tomcat installation is default and you have not done any changes, then the default war will be ROOT.war. Thus whenever you will call http://yourserver.example.com/, it will call the index.html or index.jsp of your default WAR file. Make the following changes in your webapp/ROOT folder for redirecting requests to http://yourserver.example.com/somewhere/else:
-
Open
webapp/ROOT/WEB-INF/web.xml,
remove any servlet mapping with path/index.htmlor/index.jsp,
and save. -
Remove
webapp/ROOT/index.html, if it exists. -
Create the file
webapp/ROOT/index.jspwith this line of content:<% response.sendRedirect("/some/where"); %>or if you want to direct to a different server,
<% response.sendRedirect("http://otherserver.example.com/some/where"); %>
That’s it.