【问题标题】:How to get pass index on website如何在网站上获取通过索引
【发布时间】:2014-07-02 15:41:45
【问题描述】:

如果主页是 index.html,是否可以访问网站目录文件夹(所有这些文件,例如 index.html、page1.html...)。是否有可能忽略该索引?我想查看某个目录中有哪些文件,但 index.html 总是首先弹出。我希望你能明白我想问的。

【问题讨论】:

  • 如果没有指定文件,大多数 Web 主机都配置为自动加载 index.html。您可能可以使用.htaccess 更改该配置,以便index.html 不会自动加载。
  • 我们说的是哪个网络服务器?

标签: html indexing directory


【解决方案1】:

对于 Apache,您可以通过这种方式为目录设置另一个索引:

<Directory /foo>
    DirectoryIndex index.html
    DirectoryIndex index.php
</Directory>

不确定我是否正确,但您也可以打开目录列表,它会在目录 /foo 中生成文件列表。

<Directory /foo>
    Options +Indexes
</Directory>

【讨论】:

    猜你喜欢
    • 2011-11-24
    • 2021-11-17
    • 2012-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-14
    • 1970-01-01
    • 2020-01-02
    相关资源
    最近更新 更多