【问题标题】:How to load the static html in the browser pointing to folder如何在浏览器中加载指向文件夹的静态html
【发布时间】:2017-10-29 14:12:33
【问题描述】:

我的文件夹结构,

public---|
         |-index.html
         |-static-|
                  |-static.html

当我以 localhost:4000 运行项目时,它指向公共文件夹并加载了 index.html 但现在我想加载 staic.html 我输入 localhost:4000/static 但仍然加载 index.html 任何人都可以帮助我。在此先感谢。

【问题讨论】:

  • 以这种方式输入 localhost:4000/static/static.html 或将 static.html 重命名为 index.html

标签: javascript html css angularjs directory


【解决方案1】:

请检查您的角度路由案例,如果您有“when”子句指向模板的“/”,就会发生这种情况。

.when("/", {
        templateUrl : "/"
    })

【讨论】:

    【解决方案2】:

    Apache 的解决方法

    更改您的 Apache 配置。

    将此配置元素添加到您的虚拟主机:

    <Directory /static/>
        DirectoryIndex static.html
    </Directory>
    

    【讨论】:

      猜你喜欢
      • 2020-04-13
      • 1970-01-01
      • 1970-01-01
      • 2020-08-03
      • 2012-08-21
      • 1970-01-01
      • 1970-01-01
      • 2019-03-23
      • 1970-01-01
      相关资源
      最近更新 更多