2011-01-11 37 views
1

在我的/ httpdocs /文件夾中,我需要更改index.php的文件名。我這樣做是通過編寫一個新的生產線,以我的.htaccess文件:我可以非遞歸地在.htaccess中聲明DirectoryIndex嗎?

DirectoryIndex index2.php 

然而,似乎是在/ httpdocs資料/所有子文件夾中尋找index2.php他們的DirectoryIndex文件。有沒有一種方法可以改變我的/ httpdocs /文件夾的DirectoryIndex文件,而不會遞歸地影響它下面的每個文件夾?

回答

1

你可以試試這個...

DirectoryIndex index2.php index.php index.html 

Apache將目光從左至右索引文件。

例如,如果index2.php不存在,它將查找index.php

+0

謝謝,這是訣竅! – Jarred 2011-01-11 23:35:57

相關問題