Apache允许你创build一个目录列表(当configuration时),如果你访问一个没有index.html的文件夹。
我想知道的是,是否有可能得到相同的列表,但在不同的url? 我已经在使用index.html,并希望保持这种方式 。
即,这是我正在寻找的:
http://example.com/blar/ – >加载我的index.html页面(不希望这个改变) http://example.com/blar/directory_list (我想这个URL来渲染Apache目录列表)
我会解决在DirectoryIndex指令使用位置覆盖。
DocumentRoot /var/www ... Alias /bar /var/www/foo <Location /bar> DirectoryIndex disabled </Location>
现在http://domain.tld/foo/会显示你的index.html,而http://domain.tld/bar/会给你一个目录索引。 假设你的其他configuration是这样的。