A server-side redirect can be implemented with virtually any type of web-server software. Some servers and programming languages or frameworks require a programmer to manually work with the response headers. This can be error-prone and result in poorly implemented site redirects that do not follow established standards for HTTP response headers.
Fortunately for users of the Apache Tomcat server and other standards compliant Enterprise Java web servers, a convenient redirect function is built right in. One of the easiest ways to use it is with a small JSP page. Here is an example JSP for typical server-side redirect.
<% response.sendRedirect("/some-dir/some-page.jsp"); %>
To redirect all requests from the server root (for example, http://yourserver.yourdomain.com/ ) you would put the above JSP code in a file named “index.jsp” in the Tomcat install folder for the root web-app (usually TOMCAT_INSTALL_DIR/webapps/ROOT/ ). Any user visiting your site at the root would be redirected to http://yourserver.yourdomain.com/some-dir/some-page.jsp :-).
I recommend you read the official Java documentation for the “sendRedirect” method. The documentation lists the rules you must follow when you call sendRedirect. Other tricks include automatically detecting the current application context name for redirects within a web-app, or forcing https for all redirects. Those are beyond the scope of this basic server-side redirect intro for Apache Tomcat.