Question

I have created my webpage in eclipse as Dynamic Web Project and uploaded the WebContent folder to the server (WebContent contains index.html js, imgs and css). When I call myPage.com, it works only with the url myPage.com/WebContent. Afterthat I have uploaded the content of the folder WebContent directory to the server root. Now when I call myPage.com, it display empty page. mypage.com/index.html display empty page too.

How to upload WebContent, sothat the index.html display woithout using WebContent in the url?

Was it helpful?

Solution

This can be achieved by:

  • Using URLRewrite. This thing changes URLs according to the patterns you configure. More to read: http://tomcat.apache.org/tomcat-8.0-doc/rewrite.html
  • Using redirects in the root folder - if someone requested the folder, it automatically sends you to another folder. This can be done by placing index.html in root folder containing: <meta http-equiv="refresh" content="0; url=http://mypage.com/WebContent" />;

  • Using Virtual Host - description for Tomcat 6.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top