'display tomcat localhost page using hosts file in windows

I have setup tomcat with an application deployed to ROOT location. entering localhost or 127.0.0.1 shows the application front page.

After that I modified the windows hosts file like this:

127.0.0.1 www.google.com

Now when I hit www.google.com it throws 404 error instead of the localhost page. Any idea how to route it to localhost instead?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source