Redirect Tomcat Homepage to Another URL


To redirect the Tomcat home page we need to edit file index.jsp (/opt/tomcat/webapps/ROOT/index.jsp). It is a good idea to backup the file before you doing any modification to the file. Below steps was tested on Tomcat 9.

Step 1: To make a backup file:

cp -rp index.jsp index.jsp.bak

Step 2: Now truncate the file using below cmd

> index.jsp

Step 3: Content index.jsp should be empty now. Then put below code to index.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <title>JSP Redirect</title>
          String redirectURL = "";

Step 4: Refresh your Tomcat home page

Click refresh button. Now you should see your Tomcat home page was redirect to



This entry was posted in tomcat and tagged . Bookmark the permalink.