0

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?

leppie
  • 115,091
  • 17
  • 196
  • 297
Kristopher Peter
  • 145
  • 4
  • 13
  • what's the content of index.html ? it should work in root – moped May 11 '14 at 09:59
  • well... I know :D but maybe links to external files are wrong etc, that's why I'm asking for content, not content type ;) – moped May 11 '14 at 10:13
  • but why mypage.com/WebContent works? – Kristopher Peter May 11 '14 at 10:28
  • 1
    @KristopherPeter can you post your index.html file (or link us to the example) and post your apache config? If it doesn't work with the files copied to the DocumentRoot, you either have some paths that aren't correct or there's something going on with your conf. –  May 11 '14 at 13:47

1 Answers1

2

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.

Alexey Malev
  • 6,408
  • 4
  • 34
  • 52