How to avoid webapp name in the URL? Deploying as root application in Apache Tomcat

Tech Insights

More often we need to access a web application without the WAR name. For example, consider you are deploying your application’s war file – helloworld.war. The URL to access any page will look like:

your_domain/helloworld/dashboard

Having the app name along with your already meaningful domain name might not look good. Tomcat provides you with an easy technique to address this issue. Just deploy the application as root application, i.e. rename your war as ROOT.war.

Before doing so, If you find any existing war named as ROOT.war just delete it and then deploy your ROOT.war app. With this, any URL without the webapp name will be directed to your application. So the above URL will become:

your_domain/dashboard

However, this is a quick way to solve the issue and apt only for small to medium sizes web applications that use Tomcat as a web front end.