我有一个纯HTML网站克隆到我的本地XAMPP服务器,它是在'foo‘文件夹下。在此文件夹中,只有.html文件和空.htaccess文件。当我打开URL localhost/foo时,浏览器将打开localhost/foo/index.html文件。那么问题是,服务器如何知道它是打开index.html文件的呢?
发布于 2014-10-16 19:56:50
这是由Apache配置DirectoryIndex确定的。示例:
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.php index.html index.html.varhttps://stackoverflow.com/questions/26412692
复制相似问题