我的文件夹结构,
public---|
|-index.html
|-static-|
|-static.html
当我以 localhost:4000 运行元素时,它指向公共(public)文件夹并加载 index.html,但现在我想加载 staic.html 我输入 localhost:4000/static 但仍然加载了 index.html,任何人都可以帮助我。提前致谢。
最佳答案
Apache 的解决方法
更改您的 Apache 配置。
将此配置元素添加到您的 VHost 中:
<Directory /static/>
DirectoryIndex static.html
</Directory>
关于javascript - 如何在浏览器中加载指向文件夹的静态html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44239597/