apache - myPage.com 而不是 mypage.com/WebContent

标签 apache html web-hosting webproject

我在 eclipse 中创建了我的网页作为 Dynamic Web Project 并将 WebContent 文件夹 上传到 server (WebContent 包含 index.html js、imgs 和 css)。当我调用 myPage.com 时,它仅适用于 url myPage.com/WebContent。之后,我将 文件夹 WebContent 目录的内容上传到 服务器根目录。现在,当我调用 myPage.com 时,它显示空白页面。 mypage.com/index.html 也显示空白页面。

如何上传WebContent,让index.html不使用url中的WebContent显示?

最佳答案

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

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

  • 使用 Virtual Host - Tomcat 6 的说明。

关于apache - myPage.com 而不是 mypage.com/WebContent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23591167/

相关文章:

regex - 为什么在 htaccess 正则表达式中使用双斜线点(即 :\\. )?

php - 检查是否存在以给定字符串开头的文件

html - 显示在其他元素下方的工具提示 z-index

php - 使用免费图像托管是否是 CDN 的可行替代方案?

web-hosting - 网站默认文档被安全限制拒绝?

ssh - 无法使用 Putty 访问 SSH 到 Arvixe 共享主机

php - 重启 Apache 有风险吗?

Apache mod_speling 不区分大小写的 URL 问题

javascript - 来自包含的 div 中的意外 jquery 事件行为

php - 简单的 PHP 电子邮件表单不起作用