2

我已经在 Eclipse 中创建了我的网页,Dynamic Web Project并将其上传WebContent folderserverWebContent包含index.html js, imgs and css)。当我打电话时myPage.com,它只适用于 url myPage.com/WebContent。之后,我已将folder WebContent目录的内容上传到server root. 现在当我打电话时myPage.com,它显示空白页面。mypage.com/index.html也显示空白页面。

怎么上传WebContent,让index.html显示器不用WebContent在里面url

4

1 回答 1

2

这可以通过以下方式实现:

  • 使用 URL 重写。这个东西会根据您配置的模式更改 URL。更多阅读:http: //tomcat.apache.org/tomcat-8.0-doc/rewrite.html
  • 在根文件夹中使用重定向 - 如果有人请求该文件夹,它会自动将您发送到另一个文件夹。这可以通过放置index.html在包含以下内容的根文件夹中来完成<meta http-equiv="refresh" content="0; url=http://mypage.com/WebContent" />

  • 使用虚拟主机- Tomcat 6 的描述。

于 2014-05-11T10:00:48.180 回答