【问题标题】:How to add a web page directly onto domain?如何将网页直接添加到域中?
【发布时间】:2020-08-03 05:43:13
【问题描述】:

抱歉,这里不适合提出这个问题,因为它与代码没有直接关系,但我在其他任何地方都没有找到任何帮助。

所以我为我的网站创建了一个临时登陆页面,它只是一个 .html 文件。我已将其上传到主机的 public_html 目录。为了访问该页面,我需要访问 example.com/test.html。但是,我希望能够通过访问 example.com 来访问该页面。

【问题讨论】:

  • 您可以在您的 htaccess 文件中使用以下规则:DirectoryIndex test.html 这会将页面作为根目录索引。

标签: html .htaccess directory


【解决方案1】:

您可以通过将此内容添加到 public_html 目录中的.htaccess 文件来做到这一点

RewriteEngine On

DirectoryIndex test.html 

用你的文件名替换 test.html

【讨论】:

    【解决方案2】:

    它是入口页面,对于整个入口页面,你应该使用命名index.html,将你的页面重命名为index.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-25
      • 2015-11-29
      • 2012-05-17
      相关资源
      最近更新 更多