【发布时间】:2012-07-27 06:47:33
【问题描述】:
我知道您可以在.htaccess 中使用DirectoryIndex example.html,但我需要更改特定目录的索引,如下所示:
DirectoryIndex /ex/index_file.html
或
DirectoryIndex /ex2/index_file2.html
有没有办法可以做到这一点?我不想将我正在尝试执行此操作的文件重命名为 index.html,因为它不是这样。您需要先登录,如果不是,它将重定向您;但我认为这看起来很草率。
【问题讨论】:
-
我的意思是,假设我有 2 个单独的目录。
dir1和dir2。对于dir1,我希望DirectoryIndex 为example.html,对于dir2,我希望DirectoryIndex 为another_example.html。这有帮助吗? -
哦,知道了,我想你可以在下面看到答案,我想应该可以解决
标签: apache .htaccess directoryindex