【发布时间】:2013-07-14 16:10:16
【问题描述】:
我的网站根文件夹中有以下 htaccess 文件:
# Deny access to everything by default
Order Deny,Allow
deny from all
# Allow access to html files
<Files *.html>
allow from all
</Files>
我这样做是为了防止访问除 html 文件之外的所有内容。但是,它似乎也阻止了 index.html 自动加载(例如,导航到 http://www.website.com 失败)。但是如果我特别请求 index.html(例如http://www.website.com/index.html),我可以访问它。
我怎样才能拒绝访问除 html 文件之外的所有内容并仍然自动加载 index.html?
【问题讨论】:
-
注意:我已经尝试添加 DirectoryIndex index.html 语句和特定的 Files 规则以允许 index.html,但这些都没有帮助。 :P